0

发布和获取 acks/nacks 正在按预期工作。我在这里担心的是,它不会关闭未使用的额外频道。另一方面,当 Publisher Confirms 设置为 false 时,未使用的通道将按预期关闭。

ConnectionFactory 示例:

cachingConnectionFactory.setCacheMode(CachingConnectionFactory.CacheMode.CHANNEL);                                       
cachingConnectionFactory.setChannelCacheSize(confirmChannelCacheSize);                                      
cachingConnectionFactory.setPublisherConfirms(Boolean.TRUE);
cachingConnectionFactory.setPublisherReturns(Boolean.TRUE);

RabbitTemplate 示例:

template.setMandatory(true);
template.setConfirmCallback(deepConfirmCallback);
template.setReturnCallback(returnCallback);

Spring AMQP 依赖:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-amqp</artifactId>
    <version>2.1.1.RELEASE</version>
</dependency>
4

1 回答 1

0

转载;调查……

如果您想关注它,我在 GitHub 上打开了一个问题。

于 2020-05-08T13:51:37.547 回答