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 Message -> PCF Message ?

Post new topic  Reply to topic
 JMS Message -> PCF Message ? « View previous topic :: View next topic » 
Author Message
garonne
PostPosted: Tue Aug 22, 2006 12:45 am    Post subject: JMS Message -> PCF Message ? Reply with quote

Acolyte

Joined: 26 Jan 2006
Posts: 59

In Java, how can I convert from JMS Message (javax.jms.Message) to PCF Message (com.ibm.mq.pcf.PCFMessage) ?

Thanks for any help.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Aug 22, 2006 2:26 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You have to get a Bytes Message and then get the bytes and then turn it into a PCF message.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
garonne
PostPosted: Tue Aug 22, 2006 3:14 am    Post subject: Reply with quote

Acolyte

Joined: 26 Jan 2006
Posts: 59

jefflowrey wrote:
You have to get a Bytes Message and then get the bytes and then turn it into a PCF message.


Thanks, I have found your solution here:
http://www.mqseries.net/phpBB2/viewtopic.php?t=20832&sid=1f19ef0d7c91c82e18ac512d07236371

But I still can't resolve the problem that the guy countered. Can you read the code and tell me how to correct it?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Aug 22, 2006 4:09 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Did you try the reset mentioned by bower5932?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
garonne
PostPosted: Tue Aug 22, 2006 4:19 am    Post subject: Reply with quote

Acolyte

Joined: 26 Jan 2006
Posts: 59

jefflowrey wrote:
Did you try the reset mentioned by bower5932?


I dont understand what does bower5932 means here: reset an MQMessage ? or the byte buffer? and how?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Aug 22, 2006 4:25 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

There's a reset method on the MQMessage object.

It puts the pointer into the message buffer at the start of the buffer. This pointer gets moved everytime you readXXXX or writeXXXX.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
garonne
PostPosted: Tue Aug 22, 2006 4:41 am    Post subject: Reply with quote

Acolyte

Joined: 26 Jan 2006
Posts: 59

jefflowrey wrote:
There's a reset method on the MQMessage object.

It puts the pointer into the message buffer at the start of the buffer. This pointer gets moved everytime you readXXXX or writeXXXX.


I found no method "reset" on MQMessage object. The only method I think would work is "seek". I try to do mqMsg.seek(0) but it doesn't work.
Back to top
View user's profile Send private message
garonne
PostPosted: Tue Aug 22, 2006 4:44 am    Post subject: Reply with quote

Acolyte

Joined: 26 Jan 2006
Posts: 59

In fact , I got another exception:

com.ibm.mq.MQException: MQJE001 : Code achèvement 2, raison 3001
at com.ibm.mq.pcf.MQCFH.initialize(MQCFH.java:138)
at com.ibm.mq.pcf.MQCFH.<init>(MQCFH.java:113)
at com.ibm.mq.pcf.PCFMessage.initialize(PCFMessage.java:412)
at com.ibm.mq.pcf.PCFMessage.<init>(PCFMessage.java:83)
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Aug 22, 2006 4:45 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

try readFully(byte[],0,msg.getMsgLength())
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
garonne
PostPosted: Tue Aug 22, 2006 5:06 am    Post subject: Reply with quote

Acolyte

Joined: 26 Jan 2006
Posts: 59

jefflowrey wrote:
try readFully(byte[],0,msg.getMsgLength())


Sorry, but I dont know why I should try this method.
I think readFully is used to read all bytes from an MQMessage on the Bytes Buffer ??
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Aug 22, 2006 5:13 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

sorry, you're right.

I lost track of what we were doing for a sec.


_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
garonne
PostPosted: Wed Aug 23, 2006 6:55 am    Post subject: Reply with quote

Acolyte

Joined: 26 Jan 2006
Posts: 59

Could anyone tell me what does this exception means:

com.ibm.mq.MQException: MQJE001 : Completion Code 2, reason 3001
at com.ibm.mq.pcf.MQCFH.initialize(MQCFH.java:138)
at com.ibm.mq.pcf.MQCFH.<init>(MQCFH.java:113)
at com.ibm.mq.pcf.PCFMessage.initialize(PCFMessage.java:412)
at com.ibm.mq.pcf.PCFMessage.<init>(PCFMessage.java:83)
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Aug 23, 2006 6:58 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.amqzao.doc/csq05pcf1.htm

Quote:
The MQCFH Type field value was not valid.

_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
garonne
PostPosted: Mon Aug 28, 2006 6:46 am    Post subject: Reply with quote

Acolyte

Joined: 26 Jan 2006
Posts: 59

jefflowrey wrote:
sorry, you're right.

I lost track of what we were doing for a sec.



Do you have another solution?

I found difficult to extract bytes from JMS message to make PCFMessage.
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 Message -> PCF Message ?
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.