Posted: Wed Feb 25, 2009 4:46 pm Post subject: Cannot see message on queue
Apprentice
Joined: 16 Feb 2009 Posts: 29
I have an application client that creates an MQ connection, producer and sends message to the queue. Now no exceptions occur, so when i go to MQ queue manager i expect to see the message on the queue but its not there. NB: This worked for me last week in a different java project so not too sure what i am doing wrong now.
MQ version 6.0
Details for queue connection are:
QueueToInterface=COURTLINK.TO.GENERIC
QueueManagerServer=testmim2.agd.law.test
QueueManagerPort=1415
QueueManagerName=AGDD1
MQServerChannel=S_QM_COURTLINK
ClientID=NSWAGD
Code is :
Code:
/**
* Create connection to administered objects in webshphere MQ for local court
* @return
* @throws JMSException
*/
protected static MQQueueConnectionFactory makeFactory() throws JMSException {
MQQueueConnectionFactory factory = new com.ibm.mq.jms.MQQueueConnectionFactory();
factory.setHostName(config.getWebsphereMQServer());
factory.setPort(config.getListenerPort());
factory.setQueueManager(config.getMQueueManagerName());
factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
factory.setChannel(config.getServerChannel());
return factory;
}
/**
* Select xml message from the db, and send it to the outgoing queue
*/
public void processMessages(){
QueueConnection c = null;
QueueSender sender = null;
QueueSession qSession = null;
// MQ Connection and session
MQQueueConnectionFactory factory;
try {
factory = makeFactory();
c = factory.createQueueConnection();
c.setClientID(config.getClientID());
// Note that AUTO_ACKNOWLEDGE is ignored when is transacted is true
qSession = c.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
c.start();
Queue queue1 = qSession.createQueue(config.getQFromInside());
String xmlMessage = messageJDBC.selectMessageFromXMLMessage();
TextMessage inboundXMLText = qSession.createTextMessage(xmlMessage);
sender = qSession.createSender(queue1);
System.out.println("sending xml message to queue " + queue1.getQueueName());
sender.send(inboundXMLText);
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum