What Happens When multiple Consumers share a same durable Name with different topic Filter in WorkQueue Jetstream? #6044
Replies: 3 comments 1 reply
-
You cannot have two consumers with the same name. Server will not allow it. I suspect you have two subscriptions to the same consumer which explains what you see. Can you share a code snippet, stream info and consumer info? |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for your quick response @Jarema , Pls find my code below Stream Creation: static async Task Main(string[] args) Publisher which will just send to orders.app1 or orders.app2: Consumer App1: static async Task Main(string[] args)
class Program I understand 2 consumers cannot use same name, but these are 2 different consumer apps listening to same consumer with different filterSubject. Requesting you to pls help me understand what is wrong. |
Beta Was this translation helpful? Give feedback.
-
Thank you for claifying @Jarema. |
Beta Was this translation helpful? Give feedback.
-
I have a stream in WorkQueue based Retenetion created with Jetstream.
I have instances of consumer application running. I have a consumer which starts consuming when app starts & its Durable Name is same (ex: OrderConsumer) .
Now in applicatin 1, if i create OrderConsumer#0 with SubjectFilter as orders.app1
& in application 2, if i create OrderConsumer#0 with SubjectFilter as orders.app2
I observe that if i produce message to orders.app1, The app 2 which has intrest on orders.app2 is actually getting orders.app1 message.
Why is it getting loadbalanced & not consuming by correct app with correct filter?
Can someone pls explain to me this concept of what is happening here? Ideally my understanding was only app1 would receive this message.
Beta Was this translation helpful? Give feedback.
All reactions