Skip to content

Commit d23afa2

Browse files
garyrussellartembilan
authored andcommitted
RGH-1439: AMQP: Log Warn For Misconfigured Confirm
See spring-projects/spring-amqp#1439 **cherry-pick to 5.5.x*
1 parent f4a45cc commit d23afa2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AmqpOutboundEndpoint.java

+8
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,19 @@ protected void endpointInit() {
137137
Assert.notNull(this.rabbitTemplate,
138138
"RabbitTemplate implementation is required for publisher confirms");
139139
this.rabbitTemplate.setConfirmCallback(this);
140+
if (!this.rabbitTemplate.getConnectionFactory().isPublisherConfirms()) {
141+
this.logger.warn("A confirm correlation expression is provided but the underlying connection factory "
142+
+ "does not support correlated delivery confirmations; no confirmations will be received");
143+
}
140144
}
141145
if (getReturnChannel() != null) {
142146
Assert.notNull(this.rabbitTemplate,
143147
"RabbitTemplate implementation is required for publisher confirms");
144148
this.rabbitTemplate.setReturnsCallback(this);
149+
if (!this.rabbitTemplate.getConnectionFactory().isPublisherReturns()) {
150+
this.logger.warn("A return channel is provided but the underlying connection factory "
151+
+ "does not support returned messages; none will be received");
152+
}
145153
}
146154
Duration confirmTimeout = getConfirmTimeout();
147155
if (confirmTimeout != null) {

0 commit comments

Comments
 (0)