Java Reference
In-Depth Information
"activemq-rar-5.9.0.rar" (runtime-name :
Consuming ActiveMQ messages
Well done! The hardest part is done. Now in order to consume JMS messages sent by the
ActiveMQ broker, we will add a @ResourceAdapter annotation to a message-driven
bean. This MDB will intercept bookings from the ActiveMQ broker. In order to be able to
use the @ResourceAdapter annotation, we will need to add a JBoss-specific depend-
ency to our pom.xml :
Our new annotated message bean is presented as follows (note that the property des-
tinationType is the destination now):
@MessageDriven(name = "MDBService", activationConfig = {
@ActivationConfigProperty(propertyName =
propertyValue = "java:jboss/activemq/queue/
@ActivationConfigProperty(propertyName =
propertyValue = "javax.jms.Queue"),}
public class BookingQueueReceiver implements
MessageListener {
private Logger logger;
public void onMessage(Message message) {
Search WWH ::

Custom Search