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 » JMS question

Post new topic  Reply to topic
 JMS question « View previous topic :: View next topic » 
Author Message
chades
PostPosted: Wed Jan 28, 2009 7:46 am    Post subject: JMS question Reply with quote

Newbie

Joined: 28 Jan 2009
Posts: 6

I'm new to MQ Java programming. What I would like to know is....in the following code that's been posted on this thread....

MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection();
MQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
MQQueue queue = (MQQueue) session.createQueue("CTEST");
MQQueueSender sender = (MQQueueSender) session.createSender(queue);
MQQueueReceiver receiver = (MQQueueReceiver) session.createReceiver(queue);

session.createSender(queue); DOES NOT accept MQQueue as argument.

Never mind I was using com.ibm.mq.MQQueue instead of com.ibm.mq.jms.MQQueue. Sorry

What am I missing?


Last edited by chades on Wed Jan 28, 2009 8:30 am; edited 1 time in total
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jan 28, 2009 8:11 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Split from previous post and placed in the right forum.

What you are missing is:
Quote:
MQQueue queue = (MQQueue) session.createQueue("CTEST");

Which should read
Code:
Queue myqueue = session.createQueue("CTEST");
Sender mysender = session.createSender(myqueue);


The method will accept the argument javax.jms.Queue which is another form of javax.jms.Destination.
However the method will not accept the MQQueue.
The difference is that you explicitely cast your result to MQQueue where we left it as a javax.jms.Queue.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
chades
PostPosted: Wed Jan 28, 2009 8:33 am    Post subject: JMS question Reply with quote

Newbie

Joined: 28 Jan 2009
Posts: 6

Thanks! It was a pretty stupid mistake.
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 » JMS question
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.