Skip to content

Commit 0ff3b6f

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 c58bcfe commit 0ff3b6f

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
@@ -445,6 +445,10 @@ synchronized void setTrackingClient(Client client) {
445445

446446
void setSubscriptionClient(Client client) {
447447
this.subscriptionClient = client;
448+
if (client == null && this.isSac()) {
449+
// we lost the connection
450+
this.sacActive = false;
451+
}
448452
}
449453

450454
synchronized void unavailable() {

0 commit comments

Comments
 (0)