【发布时间】: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
我想按照the manual 中的描述配置死信的max-delivery-attempts。
我尝试了Spring Boot with embedded ActiveMQ Artemis JMS server,但不知道如何设置max-delivery-attempts 值。
【问题讨论】:
标签: spring-boot activemq-artemis spring-boot-starter
在调试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);
}
}
【讨论】: