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 » WebSphere Process Server (WID/WPS/WAS+) » Posting Message in JMS queue defined on the Bus

Post new topic  Reply to topic
 Posting Message in JMS queue defined on the Bus « View previous topic :: View next topic » 
Author Message
chauhan_vin1
PostPosted: Tue Nov 11, 2008 2:23 pm    Post subject: Posting Message in JMS queue defined on the Bus Reply with quote

Apprentice

Joined: 24 Feb 2006
Posts: 36
Location: Phoenix AZ

Currenlty we are using WebSphereMQ with WPS, recently we have been told to remove WebSphere MQ and using WPD default JMS provider.

We tried to create a MQ CLient link , a bus , bus member and Queues on it. The existing client code used to post message using MQ API on the earlier WebSphereMQ queues, so the requirement was not to change the exiting client code and work like that only.

We in our Assembly diagram , we change the Binding and function selector from MQ to JMS , we are using JMS Binding class for JMS Byte message.

Everthign was going well , when we came accross with a syncronous call, one of our transaction was syncronous and now here is what is happeneing :

From the Databinding code on our Import we are setting the JMS Message Id and JMS Corel ID.

The client application retrieving it and we posting the reply back copying the message ID to corel ID , is changing the correl Id to hex...

Client program is posting back with correl Id = messag ID on hex string, and the response is completely lost this way.

Client code using the MQ API is posting the message back as this :

public void writeErrorMessage(String msg) throws MQException, IOException {
MQQueue replyToQueue = null;
try{
init();

int openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;
replyToQueue =
qMgr.accessQueue(mqProperies.getString(HonTCEConstants.MQ_ERROR_QUEUE), openOptions, null, null, null);

HonLogHelper.log("queue accessed : " + mqProperies.getString(HonTCEConstants.MQ_ERROR_QUEUE) + " and replyToQueue = " + replyToQueue);

MQPutMessageOptions pmo = new MQPutMessageOptions();

MQMessage reply = new MQMessage();

reply.writeString(msg);

reply.format = MQC.MQFMT_STRING;


HonLogHelper.log("Before writing to error queue getMessageByCorrelationID:Reading Message Id " + convertToHex(reply.messageId) + " Correlation ID = " + convertToHex(reply.correlationId));

replyToQueue.put(reply, pmo);

============================================

If they remove the line : reply.format = MQC.MQFMT_STRING;

They are posting the correl ID in the right string without changing it to Hex , We are positive to crack it and thought it would work now.

But now , when the JMS Export picks it up , we getting class cast exception in function selector :

11/11/08 14:24:16:484 MST] 000000e8 SystemOut O :::::::: jmsOutMsg CorrecId before setting::::::::null
[11/11/08 14:24:16:484 MST] 000000e8 SystemOut O --------Correlation ID--------534942200555369bb9dc21f6da0a40f10000000000000006
[11/11/08 14:24:16:484 MST] 000000e8 SystemOut O :::::::: jmsOutMsg MsgId::::::::null
[11/11/08 14:24:16:484 MST] 000000e8 SystemOut O :::::::: jmsOutMsg CorrecId after setting::::::::534942200555369bb9dc21f6da0a40f10000000000000006
[11/11/08 14:24:16:868 MST] 000000ee SibMessage I [:] CWSIC3704I: A WebSphere MQ client application has connected from host az18u472.honeywell.com:56350 on transport chain InboundBasicMQLink.
[11/11/08 14:24:16:971 MST] 000000ee SystemOut O :::::::::: Entering Function Selector :::::::::::
[11/11/08 14:24:16:971 MST] 000000ee ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "onMessage" on bean "BeanId(WebComm_RoutingModuleApp#WebComm_RoutingModuleEJB.jar#export.TCEMainframeExportEIS, null)". Exception data: java.lang.ClassCastException: com.ibm.ws.sib.api.jms.impl.JmsBytesMessageImpl
at com.wbi.classes.WebCommFunctionSelector.generateEISFunctionName(WebCommFunctionSelector.java:24)
at com.ibm.ws.sca.internal.jms.AbstractJMSInboundImpl.onMessage(AbstractJMSInboundImpl.java:194)
at com.ibm.ejs.container.MessageEndpointHandler.invokeMdbMethod(MessageEndpointHandler.java:1013)
at com.ibm.ejs.container.MessageEndpointHandler.invoke(MessageEndpointHandler.java:746)
at $Proxy51.onMessage(Unknown Source)
at com.ibm.ws.sib.api.jmsra.impl.JmsJcaEndpointInvokerImpl.invokeEndpoint(JmsJcaEndpointInvokerImpl.java:201)
at com.ibm.ws.sib.ra.inbound.impl.SibRaDispatcher.dispatch(SibRaDispatcher.java:627)
at com.ibm.ws.sib.ra.inbound.impl.SibRaSingleProcessListener$SibRaWork.run(SibRaSingleProcessListener.java:463)
at com.ibm.ejs.j2c.work.WorkProxy.run(WorkProxy.java:394)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))



Can some guru Help....!!!
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
fjb_saper
PostPosted: Tue Nov 11, 2008 2:37 pm    Post subject: Reply with quote

Grand High Poobah

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

Not so surprised. If the message has the format MQC.MQFMT_STRING it is a TextMessage and not a BytesMessage. Hence the class cast exception?

And remember msgId and correlId should never be treated as strings. JMS allows you some lattitude as it will give you the hex representation of the byte[] in form of a String.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Process Server (WID/WPS/WAS+) » Posting Message in JMS queue defined on the Bus
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.