We have SNS/SQS already setup and working, but we'd like to start moving away from AWSSDK.* and towards MassTransit.
I have successfully played around with MassTransit using both the InMemory and RabbitMq (via docker). However, I am having trouble getting MassTransit working with AWS. Everything I try results in startup errors, such as "Endpoint faulted"
All of the examples I can find seem to allow MassTransit to instantiate any queues/topics necessary according to its own naming conventions or do not show a complete configuration. I cannot find an example that explains what values to use.
Suppose I have grabbed the following strings from the AWS management console.
SNS
Name: "SNS"
DisplayName: "SNS.DisplayName"
ARN: "SNS.ARN" <- this is what I give to AWSSDK.SimpleNotificationService
SNS -> Subscription
ARN: "SNS.Sub.ARN"
Endpoint: "SNS.Sub.Endpoint
Topic: "SNS.Sub.Topic"
SQS
Name: "SQS"
ARN: "SQS.ARN"
URL: "SQS.Url"
Suppose I have this configuration:
.AddMassTransit(x =>
{
x.AddConsumer<MyConsumer>();
x.UsingAmazonSqs((context, cfg) =>
{
cfg.Host("us-west-2", h =>
{
h.AccessKey("access");
h.SecretKey("secret");
});
cfg.ReceiveEndpoint(">> What goes here? <<", e =>
{
e.UseMessageRetry(r => r
.Interval(2, TimeSpan.FromMilliseconds(5000))
);
e.ConfigureConsumeTopology = false;
e.Subscribe(">> What goes here? <<", s =>
{
s.TopicAttributes["DisplayName"] = ">> What goes here? <<";
// Is this needed?
// s.TopicSubscriptionAttributes["some-subscription-attribute"] = "some-attribute-value";
});
e.ConfigureConsumer<MyConsumer>(context);
});
});
})
.AddMassTransitHostedService()
Which values need to go where in order to be able to send/publish and consume messages? Am I missing any configuration steps?
Thanks.