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 API Support » question about MQEnvironment.CCSID field

Post new topic  Reply to topic
 question about MQEnvironment.CCSID field « View previous topic :: View next topic » 
Author Message
weixiazero
PostPosted: Mon Jul 24, 2006 6:18 pm    Post subject: question about MQEnvironment.CCSID field Reply with quote

Novice

Joined: 23 Apr 2006
Posts: 10

When coding your MQ Java API in Client Mode,value of MQEnvironment.CCSID will affect Queue Manager you connect to translates some information in MQMD of your message.
(in fact, two as I known: applicationIdData & putApplicationName)

Here comes my question that when using your MQ Java API in Binding Mode, we know MQEnvironment.CCSID doesn't apply to bindings connections,then how will the CCSID be decided?

In fact, I was confused by character encoding & decoding in MQ some little,as we can specify characterCodeSet in our program, we also can set the MCA's convert to true to let it do the work for us.Sometimes I can't simply make the judgement on choosing the way.

very appreciate receiving your reply.
Back to top
View user's profile Send private message
msukup
PostPosted: Tue Jul 25, 2006 7:42 am    Post subject: Reply with quote

Acolyte

Joined: 11 Feb 2002
Posts: 56

In bindings mode, to specify the ccsid of the message, set the field characterSet field on the message object:

Example:

myMessage.characterSet = iCCSID;

If you do not set it, then it defaults to the queue manager's ccsid. You can also explicitly set to queue manager's ccsid by setting ccsid 0.
Back to top
View user's profile Send private message MSN Messenger
weixiazero
PostPosted: Tue Jul 25, 2006 4:43 pm    Post subject: MQMessage.characterSet field Reply with quote

Novice

Joined: 23 Apr 2006
Posts: 10

hi,msukup, thank you for you reply.
Still confused by this question as you know,In both Binding & Client Mode,MQMessage.characterSet can be used, I thought it is used to specified character set for body part of the message, but not header part as I have mentioned. Is there anything wrong with my understanding?

MQEnvironment.CCSID , which can be only used in Client Mode, is used to specified character set for only two field of MQMD part in the message,as I have found in MQ's document.

If my understanding is right ,then what will take the same role in Binding Mode as MQEnvironment.CCSID have been taking in Client Mode?
Back to top
View user's profile Send private message
msukup
PostPosted: Wed Jul 26, 2006 4:38 am    Post subject: Reply with quote

Acolyte

Joined: 11 Feb 2002
Posts: 56

you are correct -- setting characterSet in the header relates to the CCSID of the message body. In bindings mode, why do you want to read the headers in anything but the the queue manager's CCSID? what is the problem that you are trying to solve that you cannot put with local ccsid?
Back to top
View user's profile Send private message MSN Messenger
weixiazero
PostPosted: Wed Jul 26, 2006 11:57 pm    Post subject: Reply with quote

Novice

Joined: 23 Apr 2006
Posts: 10

Hi,msukup.
Yes, I have met a problem I thought it was cause due to value of MQEnvironment.CCSID.
I have a test environment shows as follows:
1.Web Application running on WAS
2.QM MQM0711H which is used as local Queue Manager.(CCSID=932)
3.QM FMCQM01 which is used as remote Queue Manager.(CCSID=932)
(though located on the same machine.)

There I have a program which is connecting to the remote QM to fetch message from a specify Queue,it looks like this:
MQEnvironment.hostname = "localhost";
...set the channel, port ....
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);
Hashtable prm = new Hashtable();
prm.put(MQC.THREAD_AFFINITY, new Boolean(true));
qmgr = new MQQueueManager( "FMCQM01", prm );

As you know the default value for MQEnvironment.CCSID is 819, when the code is going to create a instance of MQQueueManager, I got
exception comes with comecode 2, reasoncode 2195 .

I surposed CCSID of 819 causes the problem, then I solved the problem with one of the following ways.
1.set MQEnvironment.hostname = null and have it connected to local QM MQM0711H. In this way, it should be changed to Binding Mode.
2.set MQEnvironment.CCSID= 932 and keep other code unchanged.So it would still in Client Mode and the CCSID is the same with the remote QM.

I still can't understand clearly the above problem. As it was happened before I do anything about message, I am not sure what will be the root cause of the problem.
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 API Support » question about MQEnvironment.CCSID field
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.