【问题标题】:How to config max-delivery-attempts for Spring Boot with Embedded ActiveMQ Artemis?如何使用嵌入式 ActiveMQ Artemis 为 Spring Boot 配置 max-delivery-attempts?
【发布时间】:2021-10-30 02:51:52
【问题描述】:

我想按照the manual 中的描述配置死信的max-delivery-attempts

我尝试了Spring Boot with embedded ActiveMQ Artemis JMS server,但不知道如何设置max-delivery-attempts 值。

【问题讨论】:

    标签: spring-boot activemq-artemis spring-boot-starter


    【解决方案1】:

    在调试Configuration 实例后,我终于找到了方法。代码如下:

    @Configuration
    public class RedeliveryConfiguration implements ArtemisConfigurationCustomizer {
    
        @Override
        public void customize(org.apache.activemq.artemis.core.config.Configuration configuration) {
            Map<String, AddressSettings> addressesSettings = configuration.getAddressesSettings();
    
            // # is the catch all address or default address
            addressesSettings.get("#").setMaxDeliveryAttempts(2);
        }
    }
    

    【讨论】:

    • 如果这是正确答案,请将其标记为正确答案,以帮助将来有同样问题的其他人。谢谢!
    猜你喜欢
    • 2021-07-15
    • 2013-05-24
    • 2016-12-09
    • 2017-02-08
    • 2020-12-29
    • 2019-09-21
    • 2015-07-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多