forked from arcus-azure/arcus.messaging
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix - combine context predicate w/ Service Bus operations (arcus-azur…
…e#135) * Fix - combine context predicate w/ Service Bus operations * pr-fix: use queue for the dead letter test * pr-fix: use correct integration test program type
- Loading branch information
1 parent
1b93c04
commit d7185b9
Showing
7 changed files
with
174 additions
and
43 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
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
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
42 changes: 42 additions & 0 deletions
42
...ests.Integration/Fixture/ServiceBusQueueContextPredicateSelectionWithDeadLetterProgram.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,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Arcus.EventGrid.Publishing; | ||
using Arcus.Messaging.Pumps.ServiceBus; | ||
using Arcus.Messaging.Tests.Core.Messages.v1; | ||
using Arcus.Messaging.Tests.Workers.MessageHandlers; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Hosting; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Arcus.Messaging.Tests.Integration.Fixture | ||
{ | ||
public class ServiceBusQueueContextPredicateSelectionWithDeadLetterProgram | ||
{ | ||
public static void main(string[] args) | ||
{ | ||
CreateHostBuilder(args) | ||
.Build() | ||
.Run(); | ||
} | ||
|
||
public static IHostBuilder CreateHostBuilder(string[] args) => | ||
Host.CreateDefaultBuilder(args) | ||
.ConfigureAppConfiguration(configuration => | ||
{ | ||
configuration.AddCommandLine(args); | ||
configuration.AddEnvironmentVariables(); | ||
}) | ||
.ConfigureLogging(loggingBuilder => loggingBuilder.AddConsole(options => options.IncludeScopes = true)) | ||
.ConfigureServices((hostContext, services) => | ||
{ | ||
services.AddServiceBusQueueMessagePump(configuration => configuration["ARCUS_SERVICEBUS_CONNECTIONSTRING"], options => options.AutoComplete = false) | ||
.WithMessageHandler<PassThruOrderMessageHandler, Order, AzureServiceBusMessageContext>(context => false) | ||
.WithServiceBusMessageHandler<CustomerMessageHandler, Customer>(context => context.Properties["Topic"].ToString() == "Customers") | ||
.WithServiceBusMessageHandler<OrdersAzureServiceBusDeadLetterMessageHandler, Order>(context => context.Properties["Topic"].ToString() == "Orders"); | ||
|
||
services.AddTcpHealthProbes("ARCUS_HEALTH_PORT"); | ||
}); | ||
} | ||
} |
Oops, something went wrong.