Replies: 2 comments 8 replies
-
@rpuppo converted this to a discussion |
Beta Was this translation helpful? Give feedback.
0 replies
-
So your code looks ok. But is this the entire code? what happens after that last log.info call? If that's the end of your program, well the program will end. Even though there is another thread running, the main program still ends. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm passing hard times trying to make multiple consumers in one single queue group sharing the load on a subject, belonging to a jetstream stream.
Here is the api call I'm using:
JetStreamSubscription subscribe(String subject, String queue, Dispatcher dispatcher, MessageHandler handler, boolean autoAck, PushSubscribeOptions options) throws IOException, JetStreamApiException;
The aim is to call this multiple time, per consumer thread, always specifying same subject, same queue and same PushSubscribeOptions and get the queue well load balanced across my consumers, but what I got is just a broad cast per consumer instance.
Dispatcher is used to make async consumption, per consumer instance.
Here below my code for a single consumer(launched on multiple instances, during test) :
Dispatcher natsJetstreamDispatcher;
Connection nc;
JetStreamManagement jsmConsumer;
jnats version: 2.13.1
nats servers: 2.6.1
Could you please help me figure out what I'm missing in order to make work subscriptions, belonging to the same queue, sharing the messages and not just receive a broadcast for each of them?
BR,
Riccardo
Beta Was this translation helpful? Give feedback.
All reactions