Infinite Loop Message Consumer
While using solace jcsmp the message consumer reiceving infinity times.
Can I stop consumer and listen again for the next message
Thank you
Comments
-
This sounds like something very broken in your code.
First, set up a Dead Message Queue, add the "DMQ Eligible" flag to your message publisher and set the queue max-redelivery count.
You need to work out how and why messages are being redelivered. Are you acknowledging the messages?
2 -
Hi. @TomF
I am using 3 micro service
One for publish to a topic
Second for consume from that topic and publish to another two topic
Third one consume from second and save to db
While running micro service it's not get acknowledged and consume infinitly
Thank you
0 -
0
-
hi @Shaz ,
Try to refer the sample codes from the github repo.
There are codes to consume persistent and direct messages.
0 -
Hi @Shaz,
Were you able to figure out the issue? Looking briefly at your code maybe on line
66
of yourUniversityConsumerApplication
you check if it's aTextMessage
and if it's not it would never be acknowledged. Could that maybe be your issue?As @jmahrok mentioned we have samples in github. Here is an example receiver that Acks the message from a queue that might be useful: https://github.com/SolaceSamples/solace-samples-java-jcsmp/blob/master/src/main/java/com/solace/samples/jcsmp/patterns/GuaranteedSubscriber.java#L141:L153
Hope that helps!
0