Replies: 3 comments 1 reply
-
Seems like a timing thing. How long between issuing the delete and the re-issue of the sub? There might be some lag amount of time that it takes for the server to remove the consumer. Also, why are you doing this, what is the use case? You could always make a unique durable name each iteration |
Beta Was this translation helpful? Give feedback.
-
[Christian Cassar] (Also I am a little surprised that my call to dispatcher unsubscribe returns null at the point indicated above - makes me wonder if maybe I am calling the wrong api?) |
Beta Was this translation helpful? Give feedback.
-
[Christian Cassar] An extra datapoint here - if I tear down client connection, and reestablish it with every iteration, issue goes away. I am trying to reproduce an issue. I initially thought it was a timing thing, but I tried with a delay at the end of the loop (30s) and issue persists. Conversely, the first run succeeds irrespective (so maybe somehow also tied to client connection lifetime? Will experiment some more. |
Beta Was this translation helpful? Give feedback.
-
Context: in the process of reproducing an issue, I have created a kotlin test to cycle through the following sequence;
create durable consumer on stream,
async subscribe to subject in consumer filter binding to consumer,
publish/receive,
unsubscribe async sub (via dispatcher)
delete consumer.
First run through works. Second run through fails with "[SUB-90012] Consumer is already bound to a subscription."
I assumed this meant that unsubscribe (step 4) had failed, and that deleting the durable consumer the subscription was bound (step 5) to have somehow survived to the second iteration.
Using the debugger, I also noticed, that when I unsubscribe using the dispatcher, sub returned is null.
Some other notes -
I did confirm using nats cli, that at the end of the first run, the consumer was indeed deleted:
Calls to nats api in test look like this:
Beta Was this translation helpful? Give feedback.
All reactions