Skip to content

Commit 29b1a3e

Browse files
committed
Set SAC status to false when connection is lost
Setting the SAC status to false is safe when the connection is lost, even if no notification came. This makes sure the consumer instance state is consistent, as a new SAC consumer is always inactive when it first registers. References #46
1 parent bf7dbb8 commit 29b1a3e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,10 @@ synchronized void setTrackingClient(Client client) {
441441

442442
void setSubscriptionClient(Client client) {
443443
this.subscriptionClient = client;
444+
if (client == null && this.isSac()) {
445+
// we lost the connection
446+
this.sacActive = false;
447+
}
444448
}
445449

446450
synchronized void unavailable() {

0 commit comments

Comments
 (0)