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 IndexIBM MQ Java / JMSSet property with subelements with java

Post new topicReply to topic
Set property with subelements with java View previous topic :: View next topic
Author Message
cozog
PostPosted: Wed Aug 03, 2016 6:05 am Post subject: Set property with subelements with java Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Wed Aug 03, 2016 6:39 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17059

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.
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
cozog
PostPosted: Wed Aug 03, 2016 10:18 pm Post subject: Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Thu Aug 04, 2016 3:24 am Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6059
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
View user's profile Send private message
mqjeff
PostPosted: Thu Aug 04, 2016 3:39 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17059

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.
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
cozog
PostPosted: Thu Aug 04, 2016 3:58 am Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Thu Aug 04, 2016 4:27 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17059

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.
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
cozog
PostPosted: Thu Aug 04, 2016 5:41 am Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu Aug 04, 2016 5:56 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24208
Location: Ohio, 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
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Java / JMSSet property with subelements with java
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.