Author |
Message
|
garonne |
Posted: Tue Aug 22, 2006 12:45 am Post subject: JMS Message -> PCF Message ? |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Aug 22, 2006 2:26 am Post subject: |
|
|
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 |
|
 |
garonne |
Posted: Tue Aug 22, 2006 3:14 am Post subject: |
|
|
Acolyte
Joined: 26 Jan 2006 Posts: 59
|
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 22, 2006 4:09 am Post subject: |
|
|
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 |
|
 |
garonne |
Posted: Tue Aug 22, 2006 4:19 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Aug 22, 2006 4:25 am Post subject: |
|
|
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 |
|
 |
garonne |
Posted: Tue Aug 22, 2006 4:41 am Post subject: |
|
|
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 |
|
 |
garonne |
Posted: Tue Aug 22, 2006 4:44 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Aug 22, 2006 4:45 am Post subject: |
|
|
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 |
|
 |
garonne |
Posted: Tue Aug 22, 2006 5:06 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Aug 22, 2006 5:13 am Post subject: |
|
|
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 |
|
 |
garonne |
Posted: Wed Aug 23, 2006 6:55 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Wed Aug 23, 2006 6:58 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
garonne |
Posted: Mon Aug 28, 2006 6:46 am Post subject: |
|
|
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 |
|
 |
|