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 Message Broker (ACE) Support » Change CCSID when sending a JMS Message

Post new topic  Reply to topic Goto page 1, 2  Next
 Change CCSID when sending a JMS Message « View previous topic :: View next topic » 
Author Message
saurabh867
PostPosted: Thu Apr 05, 2012 2:43 am    Post subject: Change CCSID when sending a JMS Message Reply with quote

Voyager

Joined: 13 Jun 2010
Posts: 78

Hi,
In one of my integration, I am sending the messages using JMSOutput node.
I want to change the CCSID of the outgoing message. I tried to do that using

Code:
set OutputRoot.JMSTransport.Transport_Folders.JMS_Provider_Properties.JMS_IBM_Character_Set = 850;


But on the application side, I still see the CCSID as 1208 (which it might be taking the default for that QM).
Is there any other way by which the CCSID can be changed when sending the message using JMS.

Regards,
saurabh
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Apr 05, 2012 4:35 am    Post subject: Re: Change CCSID when sending a JMS Message Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

saurabh867 wrote:
I want to change the CCSID of the outgoing message.


Let's just underline a point here. The CCSID of a message describes the code page used for the payload, it doesn't enforce it. So (for example) if you write a message with code page 437 then set the CCSID of the descriptor to 850 the payload doesn't suddenly become coded in 850.

So:

Do you want to change the CCSID of the descriptor to 850 because that's what you wrote the payload in?

Or:

Do you want to create a message where the payload is coded in 850?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
saurabh867
PostPosted: Thu Apr 05, 2012 4:47 am    Post subject: Change CCSID when sending a JMS Message Reply with quote

Voyager

Joined: 13 Jun 2010
Posts: 78

Hi,

The first option: I have my payload in 850 and that is how the receiver wants to expect it.

But when the message reaches to destination, the value in the Properties - CCSID gets converted to 1208.

Also the header (JMS_Provider_Properties) which I am adding while sending the message gets overwritten when received over the JMSInput node.

I want to make sure that the value I set in the above header should be copied to CCSID of MQMD when written to queue but that is not happening.

Regards,
Saurabh
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Apr 05, 2012 4:53 am    Post subject: Re: Change CCSID when sending a JMS Message Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

saurabh867 wrote:
The first option: I have my payload in 850 and that is how the receiver wants to expect it.


Thank you for the clarification.

saurabh867 wrote:
But when the message reaches to destination, the value in the Properties - CCSID gets converted to 1208.

Also the header (JMS_Provider_Properties) which I am adding while sending the message gets overwritten when received over the JMSInput node.


From which we confirm (as well as the section you're posting in) that WMB is in use. Which version? Given that the properties CCSID is set to 1208, what's the CCSID on the inbound MQMD?

saurabh867 wrote:
I want to make sure that the value I set in the above header should be copied to CCSID of MQMD when written to queue but that is not happening.


Have you looked at the message on the queue before WMB picks it up & confirmed it has 850 in it's MQMD, i.e. positively nailed where the value is being changed?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
saurabh867
PostPosted: Thu Apr 05, 2012 4:59 am    Post subject: Change CCSID when sending a JMS Message Reply with quote

Voyager

Joined: 13 Jun 2010
Posts: 78

Hi,

WMB 6.1.0.8

Right now I am sending the messages to queue with CCSID as 850 using RFHUtil for my testing.

The message is received by MQInput and then after some transformation sent to another queue using JMSOutput node. Before MQJMSTransform node, I can see CCSID of MQMD as 850.
After the transformation, I have a compute node where I am putting this value to JMS Header (JMS_Provider_Properties) so that when picked by MQ, this value should overwrite the MQ.

For my testing : I have created another flow having JMSInput to pick from the above queue, here I don't see my header. Also the value of CCSID in Properties gets changed to 1208.

Regards,
Saurabh
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Apr 05, 2012 5:06 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

I think at this point I scratch my head & pass you off onto one of my more JMS literate associates.....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Esa
PostPosted: Thu Apr 05, 2012 5:19 am    Post subject: Re: Change CCSID when sending a JMS Message Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

saurabh867 wrote:

The first option: I have my payload in 850 and that is how the receiver wants to expect it.

But when the message reaches to destination, the value in the Properties - CCSID gets converted to 1208.


AFAIK RFHUtil does not use JMS API to put the message in the queue but creates an equivivalent MQRFH2 header. I guess you know that it is the RFH2 header that must have correct CCSID for the payload? MQ headers are chained so that a headers CCSID field tells the CCSID of the next part of the message, which is the next header, or the payload if the header is the last header before the payload.
Back to top
View user's profile Send private message
saurabh867
PostPosted: Thu Apr 05, 2012 5:26 am    Post subject: Reply with quote

Voyager

Joined: 13 Jun 2010
Posts: 78

Hi,
From RFHUtil, I am simply putting an MQ message. This need not be a JMS Provider. My message flow uses MQJMSTransform node to convert it to JMS message.

I have also tried setting the CCSID in RFH2 headers before sending the message out to Destination but no use.

Regards,
Saurabh
Back to top
View user's profile Send private message
mapa
PostPosted: Thu Apr 05, 2012 8:43 am    Post subject: Reply with quote

Master

Joined: 09 Aug 2001
Posts: 257
Location: Malmö, Sweden

I just had to do a quick test, since I vaguely remembered something.

I modified and ran the JMSHeader Node Sample. (Added an MQInput --> MQ JMS Transform --> same as if sent by the JMS input)
The message is put with CCSID 819, is 819 the whole way through, but when on target queue, it is in 1208.
Reason - the JNDI destination is set as 1208...

Can also be checked in that sample when you put via the JMS input, it is 1208 already in the flow even though in the Test the header is set to 819.
Changing the destination to 850 and it is 850 in the RFH2 CCSID (the one pointing to the payload). Requires a restart of your flow though to pick up that change.

See this thread for a related discussion:
http://www.mqseries.net/phpBB2/viewtopic.php?t=60192

Tests were done on Windows 7, WMQ 7.1.0.3 and WMB 8.0.0.0
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Thu Apr 05, 2012 7:18 pm    Post subject: Reply with quote

Grand High Poobah

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

In JMS you can change the CCSID of the message by setting a CCSID on the destination. You can also change the CCSID of the message by changing the CCSID of the connection Factory.

IIRC changing the CCSID on a destination can be done dynamically using the URI form
Code:
queue:///MYQUEUE?CCSID=850


or in the JNDI definition of the queue

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
saurabh867
PostPosted: Sun Apr 08, 2012 11:00 pm    Post subject: Reply with quote

Voyager

Joined: 13 Jun 2010
Posts: 78

Hi,
I tried:

Code:
DEF QCF(qcf2) TRANSPORT(CLIENT) QMANAGER(TESTMQ) HOSTNAME(localhost) PORT(1414) CCS(850)

DEF Q(FOO) QUEUE(FOO) QMANAGER(TESTMQ) CCS(850)


But in the explorer the output message has CCSID as 437.

Where can we specify this url
Code:
queue:///MYQUEUE?CCSID=850
?

Should it be on JMSOutput Node or Connection Factory?

Regards,
Saurabh
Back to top
View user's profile Send private message
mapa
PostPosted: Mon Apr 09, 2012 12:36 am    Post subject: Reply with quote

Master

Joined: 09 Aug 2001
Posts: 257
Location: Malmö, Sweden

I suspect that MQMD ccsid is 437 and that you also have a RFH2 where ccsid is 850.

What is the values of MQMD format?
Back to top
View user's profile Send private message Visit poster's website
saurabh867
PostPosted: Mon Apr 09, 2012 3:13 am    Post subject: Reply with quote

Voyager

Joined: 13 Jun 2010
Posts: 78

Hi,
This is what I set before MQJMSTransform node:

Code:
       SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
      SET OutputRoot.MQMD.CodedCharSetId = 850;
      SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = MQFMT_STRING;
      SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId = 850;


After the node, the CodedCharSetId field in the Properties Header gets the value as 1208.
And finally when the message is put on the output queue using JMSOutputNode, the MQExplorer shows the CCSID as 437. I want it to be 850.

Regards,
Saurabh
Back to top
View user's profile Send private message
mapa
PostPosted: Mon Apr 09, 2012 5:11 am    Post subject: Reply with quote

Master

Joined: 09 Aug 2001
Posts: 257
Location: Malmö, Sweden

Hi again,

What you set in the flow will be overridden by the JNDI destination.
At least that is what I am experiencing.
I put the message with XML encoded in ISO-8859-1 (ccsid 819), using both mbtest and RfhUtil, the CCSID in both MQMD and Properties is 819 the whole way through, but on the queue it is 1208 for both MQMD and RFH2, due to that CCSID for destination is 1208? (QCF is 819).
The message I use for testing contains åäö and they are correctly converted from 819 to 1208. "Incorrectly" displayed by RfhUtil, but the hex is correct and in MQExplorer the data is also correctly displayed.

(I am using MQExplorer for changing the JNDI.)

I normally only use JMS with JNDI for testing via Apache JMeter so I am no expert on the JNDI settings. In our platform we send reqular MQ messages to our JMS applications queue managers.

I guess I have to learn a bit more myself:
Info Center - JMS message conversion approaches
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Mon Apr 09, 2012 7:46 pm    Post subject: Reply with quote

Grand High Poobah

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

saurabh867 wrote:
Hi,
This is what I set before MQJMSTransform node:

Code:
       SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
      SET OutputRoot.MQMD.CodedCharSetId = 850;
      SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = MQFMT_STRING;
      SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId = 850;


After the node, the CodedCharSetId field in the Properties Header gets the value as 1208.
And finally when the message is put on the output queue using JMSOutputNode, the MQExplorer shows the CCSID as 437. I want it to be 850.

Regards,
Saurabh

And what value do you have at that moment in the OutputRoot.Properties.CodedCharSetId field?
_________________
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 Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Change CCSID when sending a JMS 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.