AMQP Samples

要体验 AMQP 适配器,请查看 Spring Integration 样本 git 存储库提供的样本: https://github.com/SpringSource/spring-integration-samples

To experiment with the AMQP adapters, check out the samples available in the Spring Integration samples git repository at https://github.com/SpringSource/spring-integration-samples

目前,一个样本演示了 Spring Integration AMQP 适配器的基本功能,方法是使用一个出站通道适配器和一个入站通道适配器。如该样本中所示,AMQP 代理的实现使用了 RabbitMQ

Currently, one sample demonstrates the basic functionality of the Spring Integration AMQP adapter by using an outbound channel adapter and an inbound channel adapter. As AMQP broker implementation in the sample uses RabbitMQ.

为了运行示例,您需要正在运行的 RabbitMQ 实例。一个仅具有基本默认设置的本地安装就足够了。有关 RabbitMQ 的详细安装过程,请参阅 https://www.rabbitmq.com/install.html

In order to run the example, you need a running instance of RabbitMQ. A local installation with just the basic defaults suffices. For detailed RabbitMQ installation procedures, see https://www.rabbitmq.com/install.html

一旦启动样本应用程序,就在命令提示符处输入一些文本,然后一条包含已输入文本的消息会派发到 AMQP 队列。作为回应,Spring Integration 会检索该消息,并将其打印到控制台中。

Once the sample application is started, enter some text on the command prompt and a message containing that entered text is dispatched to the AMQP queue. In return, that message is retrieved by Spring Integration and printed to the console.

下图说明了此样本中使用的基本 Spring Integration 组件集:

The following image illustrates the basic set of Spring Integration components used in this sample:

spring integration amqp sample graph
Figure 1. The Spring Integration graph of the AMQP sample