From dc6162e9d3c3a0854a666fb5b55b293002512afb Mon Sep 17 00:00:00 2001 From: qibaoguang Date: Fri, 27 Feb 2015 20:53:05 +0800 Subject: [PATCH] Update 30.1.5. Receiving a message.md --- .../30.1.5. Receiving a message.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/IV. Spring Boot features/30.1.5. Receiving a message.md b/IV. Spring Boot features/30.1.5. Receiving a message.md index e69de29..c8811da 100644 --- a/IV. Spring Boot features/30.1.5. Receiving a message.md +++ b/IV. Spring Boot features/30.1.5. Receiving a message.md @@ -0,0 +1,13 @@ +### 30.1.5. 接收消息 + +当JMS基础设施能够使用时,任何bean都能够被@JmsListener注解,以创建一个监听者端点。如果没有定义JmsListenerContainerFactory,一个默认的将会被自动配置。下面的组件在someQueue目标上创建一个监听者端点。 +```java +@Component +public class MyBean { +@JmsListener(destination = "someQueue") +public void processMessage(String content) { +// ... +} +} +``` +具体查看[@EnableJms javadoc](http://docs.spring.io/spring/docs/4.1.4.RELEASE/javadoc-api/org/springframework/jms/annotation/EnableJms.html)。