Author |
Message
|
cozog |
Posted: Wed Aug 03, 2016 6:05 am Post subject: Set property with subelements with java |
|
|
Newbie
Joined: 03 Aug 2016 Posts: 4
|
Hi!
Is it possible to set a property on a mqmessage with java that has a "Sub-Element". I need the property to be in the usr-folder.
I tried following:
mqMessage.setStringProperty("global.code.test");
But the property won't go in the usr-folder. It if use the code above, the property doesn't become a child, it becomes a sibling to the usr.
Do you know a workaround?
Thanks in advance. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Aug 03, 2016 6:39 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It's not a work around.
It's a matter of making your code act on the right thing.
"mqMessage.setStringProperty" puts the value into a direct child of whatever MbElement "mqMessage" points to.
If you want the value in another location, you need to change what MbElement you are setting the string property on.
Again, not a work around. Just writing your code to match the requirements. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
cozog |
Posted: Wed Aug 03, 2016 10:18 pm Post subject: |
|
|
Newbie
Joined: 03 Aug 2016 Posts: 4
|
I've heard of something called "MbElement" (in use with mbmessage) but even after a half a hour of research, I didn't found anything about using MbElement on a MQMessage. And even though I donwloaded all websphere-dependencies, the class MbElement isn't provided.
How can I change the MbElement of a mqMessage? |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Aug 04, 2016 3:24 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
cozog wrote: |
I've heard of something called "MbElement" (in use with mbmessage) but even after a half a hour of research, I didn't found anything about using MbElement on a MQMessage. And even though I donwloaded all websphere-dependencies, the class MbElement isn't provided.
How can I change the MbElement of a mqMessage? |
MbElement is for use with IBM Integration Broker/Message broker ONLY. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Aug 04, 2016 3:39 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I was going by "sibling".
What you see for where properties are depends entirely on what you use to view it.
Put the message to a queue and actually view it with a) a tool that shows properties instead of an MQRFH2. b) a tool that shows MQRFH2 instead of properties. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
cozog |
Posted: Thu Aug 04, 2016 3:58 am Post subject: |
|
|
Newbie
Joined: 03 Aug 2016 Posts: 4
|
I am using BMC. It shows both, MQRFH2 (with it's properties) and all the other properties.
I don't get, what you're trying to say with your answer. If you could explain a bit further, how I'm supposed to move on? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Aug 04, 2016 4:27 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
An MQ message has either an MQRFH2 header on it, or properties.
The queue manager and/or queue can be configured to store data in either format.
BMC may be showing both because sometimes one will be set and sometimes the other.
Instead of BMC, you could use amqsbcg(c) to view the message and see what it looks like in a more raw format. That might tell you if your code is working - even if BMC is showing data in a confusing manner.
Otherwise, I'm mostly out of ideas. Someone else may be able to help more, but probably needs to see more of your code. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
cozog |
Posted: Thu Aug 04, 2016 5:41 am Post subject: |
|
|
Newbie
Joined: 03 Aug 2016 Posts: 4
|
Oh i thought there are the required / given properties like the corellation-id and optional properties that are stored in the rfh2 header.
Thanks for your tipps, I hope someone else is able to help more.
Thank you! |
|
Back to top |
|
 |
Vitor |
Posted: Thu Aug 04, 2016 5:56 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
cozog wrote: |
Oh i thought there are the required / given properties like the corellation-id and optional properties that are stored in the rfh2 header. |
See here _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|