Commit 506e538e authored by 赵啸非's avatar 赵啸非

更新下发消息为线程池发送

parent bf7fa4be
...@@ -23,6 +23,7 @@ import org.springframework.boot.autoconfigure.amqp.SimpleRabbitListenerContainer ...@@ -23,6 +23,7 @@ import org.springframework.boot.autoconfigure.amqp.SimpleRabbitListenerContainer
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.util.ObjectUtils;
@Configuration @Configuration
@Order(1) @Order(1)
...@@ -84,9 +85,11 @@ public class RabbitConfig { ...@@ -84,9 +85,11 @@ public class RabbitConfig {
rabbitTemplate.setConfirmCallback(new RabbitTemplate.ConfirmCallback() { rabbitTemplate.setConfirmCallback(new RabbitTemplate.ConfirmCallback() {
@Override @Override
public void confirm(CorrelationData correlationData, boolean ack, String cause) { public void confirm(CorrelationData correlationData, boolean ack, String cause) {
if(!ObjectUtils.isEmpty(correlationData)){
// 发送消息的时候发送的业务id // 发送消息的时候发送的业务id
log.info("发送消息id:{},ack:{}",correlationData.getId(),ack); log.info("发送消息id:{},ack:{}",correlationData.getId(),ack);
} }
}
}); });
rabbitTemplate.setReturnCallback(messageCallbackService); rabbitTemplate.setReturnCallback(messageCallbackService);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment