I am trying to configure MassTransit to work with Automatonymous State Machine using the Azure Service Bus and i cannot see any working examples on how to do this. We previously was using RabbitMQ which we configured using the following code. I've swapped to use Azure Service Bus instead of the .CreateUsingRabbitMq() operation, but there seems to be some misconfiguration. The official documentation is a bit light in this area.
- Operating system: Windows 10 Pro
- Visual Studio version: 2017
- Dotnet version: 2.2
I have a queue named "SomeQueue" created in Azure Service Bus
I have a StateSage cs.proj that is responsible for handling the saga workflows using Automatonymous. In its configuration, i have the following
var bus = Bus.Factory.CreateUsingAzureServiceBus(cfg =>
{
var host = cfg.Host(
new Uri(AzureServiceBusConfigurationSettings.Uri),
h =>
{
h.SharedAccessSignature(s =>
{
s.KeyName = AzureServiceBusConfigurationSettings.KeyName;
s.SharedAccessKey = AzureServiceBusConfigurationSettings.ShareAccessKey;
s.TokenTimeToLive = TimeSpan.FromDays(1);
s.TokenScope = TokenScope.Namespace;
});
});
cfg.UseSerilog();
cfg.ReceiveEndpoint(
host,
"order_saga",
e =>
{
e.UseInMemoryOutbox();
e.StateMachineSaga(someStateMachine, repository);
});
});
bus.Start();
Now i know the constant AzureServiceBusConfigurationSettings.Uri is working correctly because i am placing messages on the queue in Azure Service Bus via another project that acts as the WebApi that receive some data sends it onto the service bus.
Has anyone tried doing this or have any experience with Automatonymous?