英文:
How to enable Spring Framework 3.0.5 to support RabbitMQ?
问题
我正在一个旧版项目中工作,其中使用了Spring Framework 3.0.5。现在我需要使用RabbitMQ来满足一些业务需求。我已经按照官方链接中提供的所有文档进行了操作。
在文档中,所有建议都是使用诸如@Listener
注解之类的Spring注解,以便在消息到达队列时执行方法。问题是,这些注解在Spring Framework 3.0.5中不起作用。
那么,在不更改Spring版本的情况下,我该如何使它们起作用呢?是否有任何手动的方法来创建这样的监听器,在队列中有消息时自动触发方法调用呢?
英文:
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?
答案1
得分: 0
不要在多个地方重复提出相同的问题;这会浪费你的时间和我们的时间。
就像我在GitHub上回答的那样:
>Spring 3.0多年来一直没有得到支持;即使是Spring 4.3.x,在今年之后也将不再得到支持。
>使用Spring 3.0.x(3.0.7)的spring-amqp的最后一个版本是2013年的1.1.4.RELEASE。当时还没有注解支持;你要么必须实现MesssageListener
接口,要么可以使用MessageListenerAdapter
来调用已转换载荷的POJO方法。
>https://docs.spring.io/spring-amqp/docs/1.1.4.RELEASE/reference/html/amqp.html#d4e258
英文:
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 the MessageListenerAdapter
to invoke POJO methods with converted payloads.
> https://docs.spring.io/spring-amqp/docs/1.1.4.RELEASE/reference/html/amqp.html#d4e258
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论