无法使用 nservice 总线为 Amazon SQS 中的每个队列设置默认标签

Unable to set default tags for every queues in Amazon SQS using nservice bus

目前,我必须将我们的消息系统切换为使用 AmazonSQS,并且由于定价政策,我们必须放置标签。但是我没有找到任何添加标签的方法。

下面的方法将不起作用,因为这种方法期望队列已经存在并且我可以获得队列的 URL:

public static EndpointConfiguration CreateEndpointConfiguration(BusConfig config)
    {
        var endpointConfiguration = new EndpointConfiguration(config.QueueName);

        endpointConfiguration.LicensePath("license.xml");
        endpointConfiguration.SendFailedMessagesTo($"{config.QueueName}.Errors");
        endpointConfiguration.EnableInstallers();
        endpointConfiguration.UseSerialization<NewtonsoftSerializer>();
        endpointConfiguration.LimitMessageProcessingConcurrencyTo(10);

        endpointConfiguration.Conventions()
                             .DefiningEventsAs(type => typeof(IMessage).IsAssignableFrom(type))
                             .DefiningCommandsAs(type => typeof(ICommand).IsAssignableFrom(type));

        var transport = endpointConfiguration.UseTransport<SqsTransport>();
        transport.ClientFactory(() =>
        {
            var amazonSQSConfig = new AmazonSQSConfig()
            {
                RegionEndpoint = RegionEndpoint.USWest2
            };
            var client = new AmazonSQSClient(amazonSQSConfig);
            
            var addedTags = new Dictionary<string, string>();
            addedTags.Add("Team", "Development");
            addedTags.Add("Accounting ID", "number");

            var tagQueueRequest = new TagQueueRequest()
            {
                Tags = addedTags
            };

            client.TagQueueAsync(tagQueueRequest);
            
            return client;
        });
        transport.QueueNamePrefix("some-prefix");
        
        endpointConfiguration.Recoverability()
                             .AddUnrecoverableException<CustomException>();

        return endpointConfiguration;
    }

能否提供在配置端点时自动添加标签的解决方案? 感谢您的帮助

NServiceBus integration with SQS doesn't seem to support configuration of tags at the moment. You'd have to manually create your queues upfront with the appropriate tags or manually add tags to existing queues.

您可以在此处提出对特定软件的 SQS 传输存储库的标记支持的功能请求:https://github.com/Particular/NServiceBus.AmazonSQS