ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Unable to see Messages in Websphere Explorer send from JMS

Post new topic  Reply to topic
 Unable to see Messages in Websphere Explorer send from JMS « View previous topic :: View next topic » 
Author Message
sijtom0703
PostPosted: Mon Jan 21, 2013 8:35 am    Post subject: Unable to see Messages in Websphere Explorer send from JMS Reply with quote

Voyager

Joined: 28 May 2011
Posts: 84
Location: USA

Hi ,

I am trying to send messages from a JMS Code running locally to a local Queue. I am able to send successfully but not able to see the messages in the local Queue in WebSphere MQ Explorer. Do I need to use JNDI and JMS Administered objects for this.

Quote:

MQQueueConnectionFactory cf = new MQQueueConnectionFactory();

// Configuration values for Connection
cf.setHostName("Hostname");
cf.setPort(1414);

cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
cf.setQueueManager("TEST.JMS");
cf.setChannel("SYSTEM.DEF.SVRCONN");
MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection();
MQQueueSession session = (MQQueueSession) connection.createQueueSession(true, Session.CLIENT_ACKNOWLEDGE);
MQQueue queue = (MQQueue) session.createQueue("queue:///LQ");
MQQueueSender sender = (MQQueueSender) session.createSender(queue);
MQQueueReceiver receiver = (MQQueueReceiver) session.createReceiver(queue);

long uniqueNumber = System.currentTimeMillis() % 1000;

JMSTextMessage message = (JMSTextMessage) session.createTextMessage("MQJMSTest "+ uniqueNumber);
//MQMessage message = (MQMessage) session.createTextMessage("MQJMSTest "+ uniqueNumber);
// Start the connection
connection.start();

sender.send(message);
System.out.println("Sent message:\\n" + message);
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Jan 21, 2013 8:43 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You did not include any code that would prove that you did actually send the message correctly, nor even any code that would prove that you did actually connect or start the connection successfully.
Back to top
View user's profile Send private message
sijtom0703
PostPosted: Mon Jan 21, 2013 9:29 am    Post subject: Reply with quote

Voyager

Joined: 28 May 2011
Posts: 84
Location: USA

It is connecting though because I have a local queue LQ defined in the Queue Manager and if I delete that it is throwing

Quote:
com.ibm.msg.client.jms.DetailedInvalidDestinationException: JMSWMQ2008: Failed to open MQ queue 'LQ'. JMS attempted to perform an MQOPEN, but WebSphere MQ reported an error. Use the linked exception to determine the cause of this error. Check that the specified queue and queue manager are defined correctly.
\nFAILURE\n
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Jan 21, 2013 9:32 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

So what you're saying is that absolutely no exceptions were thrown by your code at all, even though you have included no code to catch and report them.
Back to top
View user's profile Send private message
sijtom0703
PostPosted: Tue Jan 22, 2013 7:36 am    Post subject: Reply with quote

Voyager

Joined: 28 May 2011
Posts: 84
Location: USA

Hi,

I was not doing a commit before closing a transacted session and hence not able to view the messages in Explorer

Code:
// Start the connection
          connection.start();
         
          sender.send(message);
          session.commit();
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Unable to see Messages in Websphere Explorer send from JMS
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.