Author |
Message
|
jrd |
Posted: Wed May 04, 2011 12:43 pm Post subject: mqmessage.setStringProperty adds dt="string" |
|
|
Newbie
Joined: 04 May 2011 Posts: 1
|
Greetings,
I am completely new to working with MQ but am working on a project where I have a need to put a message with a particular RFH2 Header from a VB.NET application to a queue that is being read by a JMS application.
I have gathered from other posts on similar topics that the easiest way for me to do so is to add a user property using the MQMessage.set__Property methods. However, when I do so, the receiving application is complaining that dt="string" is being added to the header and that I need to put the message without that... I've spent much of the last 2 hours digging through google & scouring the MQ (v7) .NET API documentation to no avail... Is this normal behavior of the api? Is there something I should be doing differently?
Here's a rough sample:
msg = New MQMessage()
msg.SetStringProperty("prop", "val")
q.Put(msg)
and this is what the output looks like in the usr folder
<prop dt="string">val</prop>
any help that can be provided would be appreciated... |
|
Back to top |
|
 |
shashikanth_in |
Posted: Wed May 04, 2011 7:54 pm Post subject: |
|
|
Centurion
Joined: 26 Feb 2009 Posts: 123
|
'dt' indicates the data type of the property. I thought JMS handles the user properties well. Below is what I can see in RFHUTIL usr tab.
MyProp(dt="string")=val |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed May 04, 2011 8:12 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Do you have somewhere the setting property mode = compat set?
Like in channel or on the queue?
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mvic |
Posted: Thu May 05, 2011 3:13 am Post subject: Re: mqmessage.setStringProperty adds dt="string" |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
jrd wrote: |
the receiving application is complaining that dt="string" is being added to the header and that I need to put the message without that... |
What is the receiving application, how is it parsing the message, and what is the precise appearance of its complaint? |
|
Back to top |
|
 |
SpongeCode |
Posted: Sun Jan 25, 2015 1:45 am Post subject: dt="string" is not necessary needed |
|
|
Newbie
Joined: 25 Jan 2015 Posts: 3
|
May I know is there any ways to remove this dt="string"? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Jan 25, 2015 8:23 am Post subject: Re: dt="string" is not necessary needed |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
SpongeCode wrote: |
May I know is there any ways to remove this dt="string"? |
Tell the VB.NET application to use the gmo option property in handle and look up the programming that goes with it. It should now be able to retrieve the Value as a message property passing it the property name...
Like in msg.getStringProperty(name)...
Programming for the RFH2 is going to be much more of a hassle then doing it that way...
Alternatively you could look at defining your JMS factory with an MQ level of 6, but as this version is no longer supported and version 7.0 is going out of support in September I would not recommend it...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
SpongeCode |
Posted: Mon Jan 26, 2015 7:12 pm Post subject: to get rid of [dt="string"] when creating a send m |
|
|
Newbie
Joined: 25 Jan 2015 Posts: 3
|
Thanks fjb_saper for the response.
Sorry for not stating my qns clearly. I am trying to create and send a RFH2 message. However, after created, the attributes in RFH2 usr folder showing the data type, [dt="string"] which I do not want.
For example, instead of
<DataLength>1034</DataLength>
I got this:
<DataLength dt="string" >1034</DataLength>
Is there anyway to get rid of [dt="string"] in the message that I want to send out?
Or is there any field in MQPutMessageOptions that I can set to get rid of [dt="string"] in the message? |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jan 27, 2015 7:55 am Post subject: Re: to get rid of [dt="string"] when creating a se |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
SpongeCode wrote: |
Thanks fjb_saper for the response.
Sorry for not stating my qns clearly. I am trying to create and send a RFH2 message. However, after created, the attributes in RFH2 usr folder showing the data type, [dt="string"] which I do not want.
For example, instead of
<DataLength>1034</DataLength>
I got this:
<DataLength dt="string" >1034</DataLength>
Is there anyway to get rid of [dt="string"] in the message that I want to send out?
Or is there any field in MQPutMessageOptions that I can set to get rid of [dt="string"] in the message? |
You can change the type by using the right method like setIntProperty, or get rid of it entirely by not setting message properties but building the RFH header.
I would recommend either setting the right type or/and having the receiving app use properties in handle...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
SpongeCode |
Posted: Wed Jan 28, 2015 12:50 am Post subject: to get rid of [dt="string"] when creating a send m |
|
|
Newbie
Joined: 25 Jan 2015 Posts: 3
|
Thanks fjb_saper.
I solve this problem by writing the RFH properties instead of setting the message properties.
Setting to other Property type will not solve the issue. only change the data type.
Example: [dt="string"] to [dt="i8"]
Anyway thanks alot!
 |
|
Back to top |
|
 |
|