File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
src/main/java/com/rabbitmq/client/impl/recovery Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -720,4 +720,11 @@ private void maybeDeleteRecordedAutoDeleteQueue(String queue) {
720
720
private void maybeDeleteRecordedAutoDeleteExchange (String exchange ) {
721
721
this .connection .maybeDeleteRecordedAutoDeleteExchange (exchange );
722
722
}
723
+
724
+ public void updateConsumerTag (String tag , String newTag ) {
725
+ synchronized (this .consumerTags ) {
726
+ consumerTags .remove (tag );
727
+ consumerTags .add (newTag );
728
+ }
729
+ }
723
730
}
Original file line number Diff line number Diff line change @@ -645,10 +645,14 @@ private void recoverConsumers() {
645
645
try {
646
646
String newTag = consumer .recover ();
647
647
// make sure server-generated tags are re-added. MK.
648
- synchronized (this .consumers ) {
649
- this .consumers .remove (tag );
650
- this .consumers .put (newTag , consumer );
648
+ if (tag != null && !tag .equals (newTag )) {
649
+ synchronized (this .consumers ) {
650
+ this .consumers .remove (tag );
651
+ this .consumers .put (newTag , consumer );
652
+ }
653
+ consumer .getChannel ().updateConsumerTag (tag , newTag );
651
654
}
655
+
652
656
for (ConsumerRecoveryListener crl : Utility .copy (this .consumerRecoveryListeners )) {
653
657
crl .consumerRecovered (tag , newTag );
654
658
}
You can’t perform that action at this time.
0 commit comments