Skip to content

Minor fixes #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 146 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# User-specific files
*.suo
Expand All @@ -17,13 +19,18 @@
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studo 2015 cache/options directory
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# Visual Studio 2017 auto generated files
Generated\ Files/

# MSTest test Results
[Tt]est[Rr]esult*/
Expand All @@ -38,14 +45,29 @@ TestResult.xml
[Rr]eleasePS/
dlldata.c

# Benchmark Results
BenchmarkDotNet.Artifacts/

# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json

# StyleCop
StyleCopReport.xml

# Files built by Visual Studio
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
Expand All @@ -70,14 +92,21 @@ _Chutzpah*
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# Visual Studio Trace Files
*.e2e

# TFS 2012 Local Workspace
$tf/
Expand All @@ -90,7 +119,7 @@ _ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding addin-in
# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
Expand All @@ -99,9 +128,18 @@ _TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover

# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json

# Visual Studio code coverage results
*.coverage
*.coveragexml

# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
Expand Down Expand Up @@ -129,39 +167,67 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets

# Windows Azure Build Output
# Microsoft Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
# Microsoft Azure Emulator
ecf/
rcf/

# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx

# Others
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
bower_components/
orleans.codegen.cs

# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk

# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/

# RIA/Silverlight projects
Generated_Code/
Expand All @@ -173,27 +239,92 @@ _UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak

# SQL Server files
*.mdf
*.ldf
*.ndf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser

# Microsoft Fakes
FakesAssemblies/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# VIM files
.*.swp
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# Paket dependency manager
.paket/paket.exe
paket-files/

# FAKE - F# Make
.fake/

# JetBrains Rider
.idea/
*.sln.iml

# CodeRush
.cr/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc

# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config

# Tabs Studio
*.tss

# Telerik's JustMock configuration file
*.jmconfig

# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs

# OpenCover UI analysis results
OpenCover/

# Azure Stream Analytics local run output
ASALocalRun/

# MSBuild Binary and Structured Log
*.binlog

# NVidia Nsight GPU debugger configuration file
*.nvuser

# MFractors (Xamarin productivity tool) working folder
.mfractor/
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public async Task Short_Message_Async_It_Is_Stored_In_S3_If_Exceeds_Threshold()
[Test]
public void Long_Message_S3KeyProvider_Is_Used_If_Configured()
{
var mockS3Provider = new Mock<IS3KeyPovider>();
var mockS3Provider = new Mock<IS3KeyProvider>();
mockS3Provider.Setup(m => m.GenerateName()).Returns(Constants.CustomPrefix + Guid.NewGuid().ToString("N"));

var extendedClient = new AmazonSQSExtendedClient(
Expand All @@ -153,7 +153,7 @@ public void Long_Message_S3KeyProvider_Is_Used_If_Configured()
[Test]
public async Task Long_Message_Async_S3KeyProvider_Is_Used_If_Configured()
{
var mockS3Provider = new Mock<IS3KeyPovider>();
var mockS3Provider = new Mock<IS3KeyProvider>();
mockS3Provider.Setup(m => m.GenerateName()).Returns("CustomPrefix" + Guid.NewGuid().ToString("N"));

var extendedClient = new AmazonSQSExtendedClient(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void Long_Messages_All_Are_Stored_In_S3()
[Test]
public void Long_Messages_S3KeyProvider_Is_Used_If_Configured()
{
var mockS3Provider = new Mock<IS3KeyPovider>();
var mockS3Provider = new Mock<IS3KeyProvider>();
mockS3Provider.Setup(m => m.GenerateName()).Returns(Constants.CustomPrefix + Guid.NewGuid().ToString("N"));

var extendedClient = new AmazonSQSExtendedClient(
Expand Down Expand Up @@ -75,7 +75,7 @@ public async Task Long_Message_Async_It_Is_Stored_In_S3()
[Test]
public async Task Long_Message_Async_S3KeyProvider_Is_Used_If_Configured()
{
var mockS3Provider = new Mock<IS3KeyPovider>();
var mockS3Provider = new Mock<IS3KeyProvider>();
mockS3Provider.Setup(m => m.GenerateName()).Returns(Constants.CustomPrefix + Guid.NewGuid().ToString("N"));

var extendedClient = new AmazonSQSExtendedClient(
Expand Down
18 changes: 12 additions & 6 deletions src/Amazon.SQS.ExtendedClient/Amazon.SQS.ExtendedClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@
<AssemblyVersion>1.2.1</AssemblyVersion>
<AssemblyFileVersion>1.0.0</AssemblyFileVersion>
<AssemblyTitle>Amazon.SQS.ExtendedClient</AssemblyTitle>
<Description>Extension to Amazon SQS that adds support for sending and receiving messages greater than 256K</Description>
<Authors>Oleg Rakitskiy</Authors>
<PackageId>Amazon.SQS.ExtendedClient</PackageId>
<Description>Fork of Amazon.SQS.ExtendedClient. Strongly named with minor bugfixes.
Extension to Amazon SQS that adds support for sending and receiving messages greater than 256K</Description>
<Authors>Dimitri Troncquo</Authors>
<PackageId>AWSSQS.ExtendClient</PackageId>
<PackageTags>AWS Amazon SQS cloud</PackageTags>
<PackageProjectUrl>https://github.com/raol/amazon-sqs-net-extended-client-lib</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/raol/amazon-sqs-net-extended-client-lib/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/raol/amazon-sqs-net-extended-client-lib</RepositoryUrl>
<PackageProjectUrl>https://github.com/dimi3tron/amazon-sqs-net-extended-client-lib</PackageProjectUrl>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. I don't get why such a change was introduced.

<PackageLicenseUrl>https://raw.githubusercontent.com/dimi3tron/amazon-sqs-net-extended-client-lib/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/dimi3tron/amazon-sqs-net-extended-client-lib</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>1.2.1</Version>
<FileVersion>1.2.1</FileVersion>
<Company>Dimitri Troncquo</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFrameworkVersion)' == 'net45'">
Expand Down
16 changes: 6 additions & 10 deletions src/Amazon.SQS.ExtendedClient/AmazonSQSExtendedClient.Net45.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
namespace Amazon.SQS.ExtendedClient
{
using System;
using Model;
using Runtime;
using S3.Model;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Model;
using Newtonsoft.Json;
using Runtime;
using S3.Model;

public partial class AmazonSQSExtendedClient
{
Expand All @@ -24,7 +20,7 @@ public override SendMessageResponse SendMessage(SendMessageRequest sendMessageRe

if (string.IsNullOrEmpty(sendMessageRequest.MessageBody))
{
throw new AmazonClientException("MessageBody cannone be null or empty");
throw new AmazonClientException("MessageBody cannot be null or empty");
}

if (!clientConfiguration.IsLargePayloadSupportEnabled)
Expand Down Expand Up @@ -174,7 +170,7 @@ private SendMessageBatchRequestEntry StoreMessageInS3(SendMessageBatchRequestEnt
{
CheckMessageAttributes(batchEntry.MessageAttributes);

var s3Key = clientConfiguration.S3KeyPovider.GenerateName();
var s3Key = clientConfiguration.Is3KeyProvider.GenerateName();
var messageContentStr = batchEntry.MessageBody;
var messageContentSize = Encoding.UTF8.GetBytes(messageContentStr).LongCount();

Expand All @@ -194,7 +190,7 @@ private SendMessageRequest StoreMessageInS3(SendMessageRequest sendMessageReques
{
CheckMessageAttributes(sendMessageRequest.MessageAttributes);

var s3Key = clientConfiguration.S3KeyPovider.GenerateName();
var s3Key = clientConfiguration.Is3KeyProvider.GenerateName();
var messageContentStr = sendMessageRequest.MessageBody;
var messageContentSize = Encoding.UTF8.GetBytes(messageContentStr).LongCount();

Expand Down
Loading