I am having a configuration problem with mass transit. It generates queues with MachineName_iisexpress... on AWS SQS.
I have the following config on startup:
services.AddMassTransit(busRegistrationConfiguration =>
{
busRegistrationConfiguration.AddConsumer<GenericConsumer>();
busRegistrationConfiguration.UsingAmazonSqs((context, cfg) =>
{
string awsRegion = Configuration.GetValue<string>("AWS-Region");
cfg.Host(awsRegion, host =>
{
host.AccessKey(Configuration.GetValue<string>("AWS-AccessID"));
host.SecretKey(Configuration.GetValue<string>("AWS-Secret"));
});
cfg.AutoStart = true;
cfg.ReceiveEndpoint("nxt-sqs-dev", x =>
{
x.UseMessageRetry(r => r.Interval(2, TimeSpan.FromMilliseconds(5000)));
x.ConfigureConsumeTopology = false;
x.Subscribe("fe-nxt-sqs-dev");
x.Consumer<GenericConsumer>(context);
});
//cfg.ConfigureEndpoints(context);
});
});
I did try to change the configuration but I couldn't solve my issue, did check the documentation etc.
Do not set cfg.AutoStart = true;
unless you want MassTransit to start the bus endpoint (which uses a unique temporary queue name, in your case, MachineName_iisexpress_etc...). The bus endpoint is only used when you are using the request client from that bus instance. Remove that statement and MassTransit won't create the bus endpoint or its queue unless you actually use the request client from that bus instance.
Also, unrelated, but you should be configuring your consumer using:
x.ConfigureConsumer<GenericConsumer>(context)