Java Reference
In-Depth Information
@ActivationConfigProperty(propertyName =
propertyValue = "javax.jms.Queue"),}
public class BookingQueueReceiver implements
MessageListener {
private Logger logger;
public void onMessage(Message message) {
try {
final String text =
message.getBody(String.class);"Received message " + text);
} catch (JMSException ex) {
Here we have connected the MDB to our ticketQueue destination [1] bound at
java:jboss/jms/queue/ticketQueue . The purpose of this component will be to
trace the message receipt via java.util.Logger .
Java EE 7 introduces an additional way of the queue definition. Now, you don't have to
add a queue from the application server management tool. It is possible to define queues
and their properties in the code using some basic annotations:
package com.packtpub.wflydevelopment.chapter6.jms;
import javax.jms.JMSDestinationDefinition;
name = BookingQueueDefinition.BOOKING_QUEUE ,
interfaceName = "javax.jms.Queue"
public class BookingQueueDefinition {
Search WWH ::

Custom Search