Author |
Message
|
h4tech |
Posted: Fri Apr 17, 2009 11:41 pm Post subject: SetStringProperty not working!!' |
|
|
Newbie
Joined: 17 Apr 2009 Posts: 4
|
Sorry if this is a duplicate question..My search didnt give a result..Here is my issue.
Iam using weblogic 8.1 application server with JMS messaging bridge
configured to interact with MQ. I have a client who expects the character set to be in iso-
8859 and i think by setting JMS_IBM_CHARACTER_SET to 819 will do it.In my test bed I
used
BytesMessage.setStringProperty("JMS_IBM_CHARACTER_SET","819")
and when i tried to retrieve the value while reading the message using
getStringProperty("JMS_IBM_CHARACTER_SET") the value is always coming as
1028, which i believe is the default character set.
Any help how to set it properly wuld be gr8.
Also the custom values which i set using setStringProperty are missing when
it comes through MQ. I mean if i set Message.setStringProperty("XXXX","SOME
VALUE") and when i retrieve it using getStringProperty im getting null. The
same works fine when i deal with Internal Weblogic JMS queues. Im wondering
whether this is getting lost while doing the mapping from JMS message
Object Structure to MQ Message Object. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Apr 18, 2009 12:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Try setting the CCSID on the connection factory, or if need be on the destination. Remember as well that the CCSID has little to no effect on a BytesMessage. You may want to use a TextMessage.
For the properties they only work if the destination is JMS. If the targetClient is MQ (1) you will strip all properties that are held in the RFH2 header. Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
h4tech |
Posted: Sat Apr 18, 2009 1:00 am Post subject: |
|
|
Newbie
Joined: 17 Apr 2009 Posts: 4
|
Thanks for the Reply,
I know CCSID has no effect on the BytesMessage, but my target is a webmethod MQ adaptor and this adaptor checks for the CCSID value in the header
(Im not sure abt how this adaptor works)and if the value is anything other than "iso.." the message is automatically rejected. This is the reason why i
require the proper value to be sent. I dont have any control on the MQ side and this application is quite huge and communicates with other systems through MQ..Is it like if the target client is not MQ, there no use in setting this value??
One more thing which i didnt have clarity after reading abt IBM documentation was that, wil the MQ convert the textmessage to the default encoding if sender is not setting a CCSID value or it just sets the value in the header??.. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Apr 19, 2009 12:30 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
h4tech wrote: |
Thanks for the Reply,
I know CCSID has no effect on the BytesMessage, but my target is a webmethod MQ adaptor and this adaptor checks for the CCSID value in the header |
And that is relevant how? Are you sending text? Try using a TextMessage.
h4tech wrote: |
(Im not sure abt how this adaptor works)and if the value is anything other than "iso.." the message is automatically rejected. This is the reason why i require the proper value to be sent. I dont have any control on the MQ side and this application is quite huge and communicates with other systems through MQ..Is it like if the target client is not MQ, there no use in setting this value?? |
Now we are getting a little bit further.
If your application is setting a String property on the message the Destination needs to be of targetClient JMS (=0 ? Look up the appropriate constant). If the targetClient is MQ there is no RFH header. The String property you set gets stored in the RFH header...
h4tech wrote: |
One more thing which i didnt have clarity after reading abt IBM documentation was that, wil the MQ convert the textmessage to the default encoding if sender is not setting a CCSID value or it just sets the value in the header??.. |
MQ will convert a TextMessage only. It gets written to the queue in the CCSID of the sender (default) or in the CCSID put on the destination in JNDI (The qmgr will do the conversion for you).
The sender can specify a CCSID on the message or on the connection factory, but then it is the sender's responsability to supply the message content in said CCSID (CodedCharSetID)  _________________ MQ & Broker admin |
|
Back to top |
|
 |
h4tech |
Posted: Tue Apr 21, 2009 1:04 am Post subject: |
|
|
Newbie
Joined: 17 Apr 2009 Posts: 4
|
I was trying to figure out where things are going wrong when i set the codedcharacterset using setStringProperty.
To set the context i will explain how the test bed is
I have two Queuemanagers..
1.Having remote MQ queue which is being bridged with my Weblogic APPlication1's local JMS queue into which my app will put the message. Here before sending the message i set the setStringPropery("JMS_IBM_Charset",819)
2.Second having a local queue which is being bridged with APPlication2's local JMS queue from which i recieve the message
After putting the message from my APP1, we used AMQSBCG on the Queue under first Qmgr and i got the following values which are correct and this is what i have set
Encoding : 273 CodedCharSetId : 819
But when i used the AMQSBCG on the second Queue on the recieving end the values became
Encoding : 273 CodedCharSetId : 1208
How come this CodedCharSetId value changed from 819 to 1208(which is the default) after trasmitting ??..Is there any way to retain this?
 |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Apr 21, 2009 12:18 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
h4tech wrote: |
I was trying to figure out where things are going wrong when i set the codedcharacterset using setStringProperty.
To set the context i will explain how the test bed is
I have two Queuemanagers..
1.Having remote MQ queue which is being bridged with my Weblogic APPlication1's local JMS queue into which my app will put the message. Here before sending the message i set the setStringPropery("JMS_IBM_Charset",819)
2.Second having a local queue which is being bridged with APPlication2's local JMS queue from which i recieve the message
After putting the message from my APP1, we used AMQSBCG on the Queue under first Qmgr and i got the following values which are correct and this is what i have set
Encoding : 273 CodedCharSetId : 819
But when i used the AMQSBCG on the second Queue on the recieving end the values became
Encoding : 273 CodedCharSetId : 1208
How come this CodedCharSetId value changed from 819 to 1208(which is the default) after trasmitting ??..Is there any way to retain this?
 |
Well you're going about it the wrong way as you just found out.
a) you did not ensure that the content of the message was in CCSID 819, yet you tried to set this on the message....
Try following. Do not specify anything in code. Set up the destination in WAS to have CCSID 819 and watch the message go...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
h4tech |
Posted: Thu Apr 23, 2009 3:43 am Post subject: |
|
|
Newbie
Joined: 17 Apr 2009 Posts: 4
|
Quote: |
a) you did not ensure that the content of the message was in CCSID 819, yet you tried to set this on the message....
|
I have encoded the string in the right encoding before setting it, eventhough it is not required for me. By the way will MQ check whether my content is not encoded properly and convert it into the right one?..I dont think so
Quote: |
Try following. Do not specify anything in code. Set up the destination in WAS to have CCSID 819 and watch the
|
I didnt ve any luck in getting this done..I culdnt find it in the weblogic console for configuring ccsid. Anyways im givin up this try and plannin for a work around.But would be nice for my knwldge to knw why the value of ccsid is changing from one Qmgr to another?
Anyways thank you very much for ur time and kind reply. |
|
Back to top |
|
 |
|