*I am able to successfully consume a message in a MDB from websphere Queue.*
Created an EJB project with the below MDB. Added RAR file to EAR project for
this test,

Sample Code:
import java.util.Date;

import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
@MessageDriven(activationConfig = {
                @ActivationConfigProperty(propertyName = "destinationType", 
propertyValue
= "javax.jms.Queue"),
      // 
@ActivationConfigProperty(propertyName="messagingType",propertyValue="javax.jms.MessageListener"),
        @ActivationConfigProperty(propertyName = "destination",
propertyValue = "QUEUE1"),
       // @ActivationConfigProperty(propertyName = "useJNDI", propertyValue
= "true"),
        @ActivationConfigProperty(propertyName = "channel", propertyValue =
"SYSTEM.ADMIN.SVRCONN"),
        @ActivationConfigProperty(propertyName = "hostName", propertyValue =
"10.x.y.z"),
        @ActivationConfigProperty(propertyName = "queueManager",
propertyValue = "QM_TIERL"),
        @ActivationConfigProperty(propertyName = "port", propertyValue =
"1414"),
        @ActivationConfigProperty(propertyName = "transportType",
propertyValue = "CLIENT"),
        @ActivationConfigProperty(propertyName = "username", propertyValue =
"x.y.z"),
        @ActivationConfigProperty(propertyName = "password", propertyValue =
"x.y.z")
                
                },
                                name = "mdbtest"
                )
public class mdbtest implements MessageListener {

        @Override
        public void onMessage(Message message) {
                
                if (message instanceof TextMessage) {
                        System.out.println("IBM Message Received at: " + new 
Date().toString());
                        TextMessage textMessage = (TextMessage) message;
                        try {
                                System.out.println("IBM Message Text: " + 
textMessage.getText());
                        } catch (JMSException e) {
                                e.printStackTrace();
                        }
                }


        }

}




--
View this message in context: 
http://openejb.979440.n4.nabble.com/websphere-MQ-tp4658647p4659098.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to