In below MDB code fragment which will be deployed in JBoss and IBM MQ as the message provider, what is the use of @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
annotation? Why is it kept on class level?
import javax.ejb.*;
import javax.jms.Message;
import javax.jms.TextMessage;
import javax.jms.JMSException;
import javax.ejb.MessageDriven;
import javax.jms.MessageListener;
import javax.ejb.ActivationConfigProperty;
import org.jboss.ejb3.annotation.ResourceAdapter;
@MessageDriven( name="MyMDB",
activationConfig =
{
@ActivationConfigProperty(propertyName = "destinationType",propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "false"),
@ActivationConfigProperty(propertyName = "hostName", propertyValue = "MQ.HOST.NAME"),
@ActivationConfigProperty(propertyName = "port", propertyValue = "MQ.PORT"),
@ActivationConfigProperty(propertyName = "channel", propertyValue = "MQ.CHANNEL.NAME"),
@ActivationConfigProperty(propertyName = "queueManager", propertyValue = "MQ.QUEUE.MANAGER"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "MQ.QUEUE.NAME"),
@ActivationConfigProperty(propertyName = "transportType", propertyValue = "MQ.CLIENT")
})
@ResourceAdapter(value = "wmq.jmsra.rar")
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class MyMDB implements MessageListener{
public void onMessage(Message message) {
TextMessage textMessage = (TextMessage) message;
try {
System.out.println("nnt Message Received by MDB : "+ textMessage.getText());
} catch (JMSException e) {
e.printStackTrace();
}
}
}