Skip to content

Commit

Permalink
capture settled cc and name when fast
Browse files Browse the repository at this point in the history
  • Loading branch information
scottf committed Aug 27, 2023
1 parent cc47fdb commit 36d5dd5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/main/java/io/nats/client/impl/NatsJetStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,11 @@ else if (inboxDeliver == null) {
// If the consumer exists, I know what the settled info is
final String settledConsumerName;
final ConsumerConfiguration settledServerCC;
if (so.isFastBind()) {
settledServerCC = null; // not needed for fast bind which is only allowed on normal pulls
if (so.isFastBind() || serverCC != null) {
settledServerCC = serverCC;
settledConsumerName = so.getName();
}
else if (serverCC == null) {
else {
ConsumerConfiguration.Builder ccBuilder = ConsumerConfiguration.builder(userCC);

// Pull mode doesn't maintain a deliver subject. It's actually an error if we send it.
Expand All @@ -411,10 +411,6 @@ else if (serverCC == null) {
settledServerCC = ccBuilder.build();
settledConsumerName = null;
}
else {
settledServerCC = serverCC;
settledConsumerName = consumerName;
}

// 6. create the subscription. lambda needs final or effectively final vars
final MessageManager mm;
Expand Down

0 comments on commit 36d5dd5

Please sign in to comment.