@@ -219,7 +219,7 @@ public class RabbitTemplate extends RabbitAccessor // NOSONAR type line count
219
219
@ Nullable
220
220
private ConfirmCallback confirmCallback ;
221
221
222
- private ReturnsCallback returnCallback ;
222
+ private ReturnsCallback returnsCallback ;
223
223
224
224
private Expression mandatoryExpression = new ValueExpression <Boolean >(false );
225
225
@@ -466,13 +466,13 @@ public void setConfirmCallback(ConfirmCallback confirmCallback) {
466
466
*/
467
467
@ Deprecated
468
468
public void setReturnCallback (ReturnCallback returnCallback ) {
469
- Assert .state (this .returnCallback == null || this .returnCallback .delegate () == returnCallback ,
469
+ Assert .state (this .returnsCallback == null || this .returnsCallback .delegate () == returnCallback ,
470
470
"Only one ReturnCallback is supported by each RabbitTemplate" );
471
- this .returnCallback = new ReturnsCallback () {
471
+ this .returnsCallback = new ReturnsCallback () {
472
472
473
473
@ Override
474
474
public void returnedMessage (ReturnedMessage returned ) {
475
- returnedMessage (returned .getMessage (), returned .getReplyCode (), returned .getReplyText (),
475
+ returnCallback . returnedMessage (returned .getMessage (), returned .getReplyCode (), returned .getReplyText (),
476
476
returned .getExchange (), returned .getRoutingKey ());
477
477
}
478
478
@@ -485,9 +485,9 @@ public ReturnCallback delegate() {
485
485
}
486
486
487
487
public void setReturnsCallback (ReturnsCallback returnCallback ) {
488
- Assert .state (this .returnCallback == null || this .returnCallback == returnCallback ,
488
+ Assert .state (this .returnsCallback == null || this .returnsCallback == returnCallback ,
489
489
"Only one ReturnCallback is supported by each RabbitTemplate" );
490
- this .returnCallback = returnCallback ;
490
+ this .returnsCallback = returnCallback ;
491
491
}
492
492
493
493
/**
@@ -1043,7 +1043,7 @@ public void send(final String exchange, final String routingKey,
1043
1043
throws AmqpException {
1044
1044
execute (channel -> {
1045
1045
doSend (channel , exchange , routingKey , message ,
1046
- (RabbitTemplate .this .returnCallback != null
1046
+ (RabbitTemplate .this .returnsCallback != null
1047
1047
|| (correlationData != null && StringUtils .hasText (correlationData .getId ())))
1048
1048
&& RabbitTemplate .this .mandatoryExpression .getValue (
1049
1049
RabbitTemplate .this .evaluationContext , message , Boolean .class ),
@@ -1516,7 +1516,7 @@ private <S> void doSendReply(final ReplyToAddressCallback<S> replyToAddressCallb
1516
1516
replyTo .getExchangeName (),
1517
1517
replyTo .getRoutingKey (),
1518
1518
replyMessage ,
1519
- RabbitTemplate .this .returnCallback != null && isMandatoryFor (replyMessage ),
1519
+ RabbitTemplate .this .returnsCallback != null && isMandatoryFor (replyMessage ),
1520
1520
null );
1521
1521
}
1522
1522
@@ -2037,7 +2037,7 @@ private Message exchangeMessages(final String exchange, final String routingKey,
2037
2037
2038
2038
Message reply ;
2039
2039
boolean mandatory = isMandatoryFor (message );
2040
- if (mandatory && this .returnCallback == null ) {
2040
+ if (mandatory && this .returnsCallback == null ) {
2041
2041
message .getMessageProperties ().getHeaders ().put (RETURN_CORRELATION_KEY , messageTag );
2042
2042
}
2043
2043
doSend (channel , exchange , routingKey , message , mandatory , correlationData );
@@ -2524,7 +2524,7 @@ public void handleReturn(int replyCode,
2524
2524
2525
2525
@ Override
2526
2526
public void handleReturn (Return returned ) {
2527
- ReturnsCallback callback = this .returnCallback ;
2527
+ ReturnsCallback callback = this .returnsCallback ;
2528
2528
if (callback == null ) {
2529
2529
Object messageTagHeader = returned .getProperties ().getHeaders ().remove (RETURN_CORRELATION_KEY );
2530
2530
if (messageTagHeader != null ) {
0 commit comments