-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #222 from Particular/release-4.0
Release 4.0
- Loading branch information
Showing
67 changed files
with
2,009 additions
and
1,380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
assembly-versioning-scheme: Major | ||
next-version: 3.0 | ||
next-version: 4.0 | ||
branches: | ||
develop: | ||
tag: alpharelease | ||
tag: beta | ||
release: | ||
tag: rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
The current maintainers of this repo are [aws-maintainers](https://github.com/orgs/Particular/teams/aws-maintainers). | ||
|
||
The maintainers [watch](https://github.com/Particular/NServiceBus.AmazonSQS/watchers) this repo and undertake the following responsibilities: | ||
|
||
- Ensuring that the `master` and `support-x.y` branches are always releasable. "Releasable" means that the software built from the latest commit contains no known regressions from the previous release and can be released immediately. | ||
- This does not imply that the latest commit should *always* be released, only that it *can* be, immediately after deciding to release. | ||
- Releasing new versions of the software. | ||
- Reviewing and merging pull requests](https://github.com/Particular/NServiceBus.AmazonSQS/pulls). | ||
- [Issue backlog](https://github.com/Particular/NServiceBus.AmazonSQS/issues) grooming, including the triage of new issues as soon as possible after they are created. | ||
- Managing the repo settings (options, collaborators & teams, branches, etc.). | ||
|
||
## Merging pull requests | ||
|
||
### Summarized workflow for merging pull requests: | ||
|
||
1. Reviewer: Request changes or comment. | ||
2. Submitter: Push fixup. | ||
3. (Repeat) | ||
4. Reviewer: Request squash. | ||
5. Submitter: Squash and force push. | ||
6. Reviewer: Approve. | ||
7. (Any maintainer): Merge. | ||
|
||
### Details | ||
|
||
- A pull request must be approved by two maintainers before it is merged. | ||
- A pull request created by a maintainer is implicitly approved by that maintainer. | ||
- Before approving, the maintainer should consider whether a smoke test is required. | ||
- Approval is given by submitting a review and choosing the **Approve** option: | ||
- For some pull requests, it may be appropriate to require a third maintainer to give approval before the pull request is merged. This may be requested by either of the current approvers based on their assessment of factors such as the impact or risk of the changes. | ||
- An approved pull request may be merged by any maintainer. | ||
|
||
### Branching and workflow | ||
|
||
This repository follows the [GitFlow](http://nvie.com/posts/a-successful-git-branching-model/) branching model and workflow. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net452;netcoreapp2.0</TargetFrameworks> | ||
<SignAssembly>true</SignAssembly> | ||
<AssemblyOriginatorKeyFile>$(SolutionDir)Test.snk</AssemblyOriginatorKeyFile> | ||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\NServiceBus.AmazonSQS\NServiceBus.AmazonSQS.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="AWSSDK.S3" Version="3.*" /> | ||
<PackageReference Include="AWSSDK.SQS" Version="3.*" /> | ||
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="7.0.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" /> | ||
<PackageReference Include="NUnit" Version="3.7.*" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0-alpha1" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/AcceptanceTests/CustomEndpointConfigurationExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace NServiceBus.AcceptanceTests | ||
{ | ||
using Configuration.AdvancedExtensibility; | ||
|
||
public static class CustomEndpointConfigurationExtensions | ||
{ | ||
public static TransportExtensions<SqsTransport> ConfigureSqsTransport(this EndpointConfiguration configuration) | ||
{ | ||
return new TransportExtensions<SqsTransport>(configuration.GetSettings()); | ||
} | ||
} | ||
} |
113 changes: 113 additions & 0 deletions
113
...AcceptanceTests/DelayedDelivery/SendOnly_Sending_when_receiver_not_properly_configured.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
namespace NServiceBus.AcceptanceTests.DelayedDelivery | ||
{ | ||
using System; | ||
using System.Threading.Tasks; | ||
using AcceptanceTesting; | ||
using AcceptanceTesting.Customization; | ||
using Amazon.SQS.Model; | ||
using EndpointTemplates; | ||
using NUnit.Framework; | ||
|
||
public class SendOnly_Sending_when_receiver_not_properly_configured : NServiceBusAcceptanceTest | ||
{ | ||
[Test] | ||
public async Task Should_deliver_messages_only_if_below_queue_delay_time() | ||
{ | ||
var payload = "some payload"; | ||
var delay = QueueDelayTime.Subtract(TimeSpan.FromSeconds(1)); | ||
|
||
var context = await Scenario.Define<Context>() | ||
.WithEndpoint<SendOnlySender>(b => b.When(async (session, c) => | ||
{ | ||
var sendOptions = new SendOptions(); | ||
sendOptions.DelayDeliveryWith(delay); | ||
|
||
c.SentAt = DateTime.UtcNow; | ||
|
||
await session.Send(new DelayedMessage | ||
{ | ||
Payload = payload | ||
}, sendOptions); | ||
})) | ||
.WithEndpoint<NotConfiguredReceiver>() | ||
.Done(c => c.Received) | ||
.Run(); | ||
|
||
Assert.GreaterOrEqual(context.ReceivedAt - context.SentAt, delay, "The message has been received earlier than expected."); | ||
Assert.AreEqual(payload, context.Payload, "The received payload doesn't match the sent one."); | ||
} | ||
|
||
[Test] | ||
public void Should_fail_to_send_message_if_above_queue_delay_time() | ||
{ | ||
var delay = QueueDelayTime.Add(TimeSpan.FromSeconds(1)); | ||
|
||
Assert.ThrowsAsync<QueueDoesNotExistException>(async () => | ||
{ | ||
await Scenario.Define<Context>() | ||
.WithEndpoint<SendOnlySender>(b => b.When(async (session, c) => | ||
{ | ||
var sendOptions = new SendOptions(); | ||
sendOptions.DelayDeliveryWith(delay); | ||
|
||
await session.Send(new DelayedMessage | ||
{ | ||
Payload = "" | ||
}, sendOptions); | ||
})) | ||
.Run(); | ||
}); | ||
} | ||
|
||
static readonly TimeSpan QueueDelayTime = TimeSpan.FromSeconds(3); | ||
|
||
public class Context : ScenarioContext | ||
{ | ||
public bool Received { get; set; } | ||
public string Payload { get; set; } | ||
public DateTime SentAt { get; set; } | ||
public DateTime ReceivedAt { get; set; } | ||
} | ||
|
||
public class SendOnlySender : EndpointConfigurationBuilder | ||
{ | ||
public SendOnlySender() | ||
{ | ||
EndpointSetup<DefaultServer>(builder => | ||
{ | ||
builder.ConfigureTransport().Routing().RouteToEndpoint(typeof(DelayedMessage), typeof(NotConfiguredReceiver)); | ||
builder.SendOnly(); | ||
|
||
builder.ConfigureSqsTransport().UnrestrictedDurationDelayedDelivery(QueueDelayTime); | ||
}); | ||
} | ||
} | ||
|
||
public class NotConfiguredReceiver : EndpointConfigurationBuilder | ||
{ | ||
public NotConfiguredReceiver() | ||
{ | ||
EndpointSetup<DefaultServer>(); | ||
} | ||
|
||
public class MyMessageHandler : IHandleMessages<DelayedMessage> | ||
{ | ||
public Context Context { get; set; } | ||
|
||
public Task Handle(DelayedMessage message, IMessageHandlerContext context) | ||
{ | ||
Context.Received = true; | ||
Context.Payload = message.Payload; | ||
Context.ReceivedAt = DateTime.UtcNow; | ||
|
||
return Task.FromResult(0); | ||
} | ||
} | ||
} | ||
|
||
public class DelayedMessage : IMessage | ||
{ | ||
public string Payload { get; set; } | ||
} | ||
} | ||
} |
117 changes: 117 additions & 0 deletions
117
...ests/DelayedDelivery/SendOnly_Sending_when_sender_and_receiver_are_properly_configured.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
namespace NServiceBus.AcceptanceTests.DelayedDelivery | ||
{ | ||
using System; | ||
using System.Threading.Tasks; | ||
using AcceptanceTesting; | ||
using AcceptanceTesting.Customization; | ||
using EndpointTemplates; | ||
using NUnit.Framework; | ||
|
||
public class SendOnly_Sending_when_sender_and_receiver_are_properly_configured : NServiceBusAcceptanceTest | ||
{ | ||
[Test] | ||
public async Task Should_deliver_message_if_below_queue_delay_time() | ||
{ | ||
var payload = "some payload"; | ||
var delay = QueueDelayTime.Subtract(TimeSpan.FromSeconds(1)); | ||
|
||
var context = await Scenario.Define<Context>() | ||
.WithEndpoint<SendOnlySender>(b => b.When(async (session, c) => | ||
{ | ||
var sendOptions = new SendOptions(); | ||
sendOptions.DelayDeliveryWith(delay); | ||
|
||
c.SentAt = DateTime.UtcNow; | ||
|
||
await session.Send(new DelayedMessage | ||
{ | ||
Payload = payload | ||
}, sendOptions); | ||
})) | ||
.WithEndpoint<Receiver>() | ||
.Done(c => c.Received) | ||
.Run(); | ||
|
||
Assert.GreaterOrEqual(context.ReceivedAt - context.SentAt, delay, "The message has been received earlier than expected."); | ||
Assert.AreEqual(payload, context.Payload, "The received payload doesn't match the sent one."); | ||
} | ||
|
||
[Test] | ||
public async Task Should_deliver_message_if_above_queue_delay_time() | ||
{ | ||
var payload = "some payload"; | ||
var delay = QueueDelayTime.Add(TimeSpan.FromSeconds(1)); | ||
|
||
var context = await Scenario.Define<Context>() | ||
.WithEndpoint<SendOnlySender>(b => b.When(async (session, c) => | ||
{ | ||
var sendOptions = new SendOptions(); | ||
sendOptions.DelayDeliveryWith(delay); | ||
|
||
c.SentAt = DateTime.UtcNow; | ||
|
||
await session.Send(new DelayedMessage | ||
{ | ||
Payload = payload | ||
}, sendOptions); | ||
})) | ||
.WithEndpoint<Receiver>() | ||
.Done(c => c.Received) | ||
.Run(); | ||
|
||
Assert.GreaterOrEqual(context.ReceivedAt - context.SentAt, delay, "The message has been received earlier than expected."); | ||
Assert.AreEqual(payload, context.Payload, "The received payload doesn't match the sent one."); | ||
} | ||
|
||
static readonly TimeSpan QueueDelayTime = TimeSpan.FromSeconds(3); | ||
|
||
public class Context : ScenarioContext | ||
{ | ||
public bool Received { get; set; } | ||
public string Payload { get; set; } | ||
public DateTime SentAt { get; set; } | ||
public DateTime ReceivedAt { get; set; } | ||
} | ||
|
||
public class SendOnlySender : EndpointConfigurationBuilder | ||
{ | ||
public SendOnlySender() | ||
{ | ||
EndpointSetup<DefaultServer>(builder => | ||
{ | ||
builder.ConfigureTransport().Routing().RouteToEndpoint(typeof(DelayedMessage), typeof(Receiver)); | ||
builder.SendOnly(); | ||
|
||
builder.ConfigureSqsTransport().UnrestrictedDurationDelayedDelivery(QueueDelayTime); | ||
}); | ||
} | ||
} | ||
|
||
public class Receiver : EndpointConfigurationBuilder | ||
{ | ||
public Receiver() | ||
{ | ||
EndpointSetup<DefaultServer>(builder => { builder.ConfigureSqsTransport().UnrestrictedDurationDelayedDelivery(QueueDelayTime); }); | ||
} | ||
|
||
public class MyMessageHandler : IHandleMessages<DelayedMessage> | ||
{ | ||
public Context Context { get; set; } | ||
|
||
public Task Handle(DelayedMessage message, IMessageHandlerContext context) | ||
{ | ||
Context.Received = true; | ||
Context.Payload = message.Payload; | ||
Context.ReceivedAt = DateTime.UtcNow; | ||
|
||
return Task.FromResult(0); | ||
} | ||
} | ||
} | ||
|
||
public class DelayedMessage : IMessage | ||
{ | ||
public string Payload { get; set; } | ||
} | ||
} | ||
} |
Oops, something went wrong.