I am developing an NServiceBus 8.x endpoint using the SQS Transport. I would like to control the topic names to follow our internally developed naming conventions. Using the documentation for custom topic mappings and I came up with this:
var credentials = new BasicAWSCredentials(“myKey”, “mySecret”);
var sqsClient = new AmazonSQSClient(credentials, RegionEndpoint.USEast1);
var snsClient = new AmazonSimpleNotificationServiceClient(credentials, RegionEndpoint.USEast1);
var sqsTransport = new SqsTransport(sqsClient, snsClient);
sqsTransport.MapEvent(“myCustomTopicName”);
endpoint.UseTransport(sqsTransport);
After this runs, I can see two two topics created in SNS - on called EndpointName-myCustomTopicName and another called myCustomTopicName.
If I am doing something wrong above, I am having a hard time spotting it.
I am also aware of the queue/topic name prefix and generator properties on the SqsTransport, but I would prefer to use MapEvent as I believe it is more clear. I also cannot find documentation on what the arguments to the QueueNameGenerator and TopicNameGenerator functions. If someone could provide some clarity on that, it would be very helpful. I’ve partially figured this out by running in the debugger and inspecting the values, but the second value to the TopicNameGenerator is always null with the events I have, so I can’t tell what that is for.
I cross posted this on the Particular discussion board, and got some very helpful responses from Mauro.
The documentation I was looking for was is here.