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 IndexIBM MQ Java / JMSJMS COA/COD

Post new topicReply to topic
JMS COA/COD View previous topic :: View next topic
Author Message
munden101
PostPosted: Thu Jun 22, 2006 7:19 am Post subject: JMS COA/COD Reply with quote

Novice

Joined: 13 Dec 2004
Posts: 23

How do I implement COA and COD in JMS?

Using MQ API it would be coded like this

Requesting report

MQMessage msg = new MQMessage();
msg.writeString(“Hello World!”);
msg.report = MQC.MQRO_EXCEPTION | MQC.MQRO_COA;
queue.put(msg);

Receiving the report:
replyQ = qmgr.accessQueue(qName, openOptions);
MQMessage msg = new MQMessage();
replyQ.get(msg);
if (msg.feedback == MQC.MQFB_COA){
message arrived on target queue
}

Now how do I do this in JMS? Here’s my code.

InitialContext context = new InitialContext(p);

QueueConnectionFactory qConnectionFactory = (QueueConnectionFactory) context.lookup(connectionFactoryJNDI);

Queue queue = (Queue) context.lookup(queueJNDI);

qConnection = qConnectionFactory.createQueueConnection();

qSession = qConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

QueueSender sender = qSession.createSender(queue);

TextMessage message = qSession.createTextMessage();

message.setText(messageToSend);
sender.send(message);

Queue ReplyToqueue = (Queue) context.lookup("jms/TMResponseQueue");
message.setJMSReplyTo(ReplyToqueue);

sender.close();
qSession.close();
qConnection.close();

Thanks
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Jun 22, 2006 10:27 am Post subject: Reply with quote

Grand High Poobah

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

read the using JAVA manual. It has all the correspondance tables between the MQMD attributes and the JMS Attributes
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Java / JMSJMS COA/COD
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.