Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring JMS listener - how to read messages based on a condition

I have configured Spring JMS in my project. Now my requirement is that messages are read only when the flag in a properties file in ON.

what are ways to implement this in Spring?

like image 698
user5636236 Avatar asked Nov 29 '25 20:11

user5636236


1 Answers

When asking questions like this, it's always best to show your configuration so people can provide a very specific answer.

The general solution is to use the property to set the autoStartup property to false on the listener container, or listener container factory (if using @JmsListener annotations).

Use a property placeholder, e.g. ${should.start}.

like image 114
Gary Russell Avatar answered Dec 01 '25 16:12

Gary Russell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!