Update 30.1.5. Receiving a message.md

master
qibaoguang 2015-02-27 20:53:05 +08:00
parent 00378d2979
commit dc6162e9d3
1 changed files with 13 additions and 0 deletions

View File

@ -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)。