user5636236
user5636236

Reputation: 387

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?

Upvotes: 2

Views: 1685

Answers (1)

Gary Russell
Gary Russell

Reputation: 174749

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}.

Upvotes: 5

Related Questions