I am working in a legacy project where Spring Framework 3.0.5 was used. Now I need to use RabbitMQ to meet some business requirement. I have followed all docs available in official links.
In there, all suggests to use spring annotation such as @Listener
annotation for executing a method when message is arrived in queue. The problem is, these annotations do not work with Spring Framework 3.0.5 .
So, how can I make them working without changing the spring version. Is there any manual way to create such listener that will auto trigger a method call when there will be message in the queue?
Don't ask the same question in multiple places; it wastes your time and ours.
As I answered on GitHub:
Spring 3.0 is has not been supported for several years; even Spring 4.3.x will not be supported after this year.
The last version of spring-amqp to use Spring 3.0.x (3.0.7) was the 1.1.4.RELEASE from 2013. There was no annotation support back then; you either had to implement
MesssageListener
or you could use theMessageListenerAdapter
to invoke POJO methods with converted payloads.
https://docs.spring.io/spring-amqp/docs/1.1.4.RELEASE/reference/html/amqp.html#d4e258