如何使Spring Framework 3.0.5支持RabbitMQ?

huangapple go评论72阅读模式
英文:

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

huangapple
  • 本文由 发表于 2020年10月5日 09:25:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/64201416.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定