We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c6c8769 commit 66f2eb6Copy full SHA for 66f2eb6
1 file changed
common/plugin/mq/src/main/java/com/github/cadecode/uniboot/common/plugin/mq/rabbit/RabbitCallback.java
@@ -79,5 +79,13 @@ public void afterPropertiesSet() {
79
// 设置回调
80
rabbitTemplate.setConfirmCallback(this);
81
rabbitTemplate.setReturnsCallback(this);
82
+ // 设置 correlationData 后置处理
83
+ rabbitTemplate.setCorrelationDataPostProcessor((message, correlationData) -> {
84
+ // 填充 correlationDataId 到 MessageProperties
85
+ if (ObjectUtil.isNotNull(correlationData.getId())) {
86
+ message.getMessageProperties().setCorrelationId(correlationData.getId());
87
+ }
88
+ return correlationData;
89
+ });
90
}
91
0 commit comments