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 Java / JMS » Setting Group properties in MQRFH2

Post new topic  Reply to topic
 Setting Group properties in MQRFH2 « View previous topic :: View next topic » 
Author Message
RobMcPherson
PostPosted: Thu Feb 26, 2004 8:31 am    Post subject: Setting Group properties in MQRFH2 Reply with quote

Newbie

Joined: 26 Feb 2004
Posts: 2
Location: London, UK

I am trying to set some properties in the <usr> area of MQRFH2.

The following JMS code works fine for creating a simple property:

Code:
TextMessage xmlRsp = _session.createTextMessage();
xmlRsp.setText(msg);
xmlRsp.setObjectProperty("LE_Hdr","DOC1.RESP");
_sender.send(xmlRsp);


Unfortunately in this case we must create a group with a sub property. Specifically I need the usr area to contain:

Code:
<usr>
  <LE_Hdr>
    <MsgType>DOC1.RESP</MsgType>
  </LE_Hdr>
</usr>


Any ideas as to how this can be done?
I have tried setting the value of LE_Hdr to "<MsgType>DOC1.RESP</MsgType>" but this does not work as the xml characters get replaced (e.g. < becomes &lt; ).

P.S. The use of the usr area in this manner is covered in the WebSphere Application Programming Reference (chapter 17 - MQRFH2 Rules and Formatting). This can be found at:

http://publibfp.boulder.ibm.com/epubs/html/csqzak09/csqzak09tfrm.htm
Back to top
View user's profile Send private message
vmcgloin
PostPosted: Thu Feb 26, 2004 9:48 am    Post subject: Reply with quote

Knight

Joined: 04 Apr 2002
Posts: 560
Location: Scotland

Have you tried something like this?
xmlRsp.setObjectProperty("LE_Hdr.MsgType","DOC1.RESP");

I don't know if it will work but it seems intuitive...
Back to top
View user's profile Send private message
RobMcPherson
PostPosted: Fri Feb 27, 2004 1:40 am    Post subject: Causes an exception Reply with quote

Newbie

Joined: 26 Feb 2004
Posts: 2
Location: London, UK

This seems like a sensible way of specifying structured properties but trying this generates an exception:

Code:
javax.jms.MessageFormatException: MQJMS1058: Invalid message property name: LE_Hdr.MsgType


It looks like the MQ JMS API does not support the concept of group properties. Does anyone have any approach that might work (can I get access to this information via some underlying MQ API)?
Back to top
View user's profile Send private message
jkoconnell
PostPosted: Thu Feb 24, 2005 5:58 pm    Post subject: JMS Group Properties Reply with quote

Newbie

Joined: 24 Feb 2005
Posts: 8

Rob, did you ever find a way in Java to create a group with sub-properties in the <usr> folder of a JMS message?
Back to top
View user's profile Send private message
simran
PostPosted: Sun Mar 20, 2005 1:56 pm    Post subject: Reply with quote

Newbie

Joined: 20 Mar 2005
Posts: 8

Can you let me know if you were able to accomplish the nested headers for RFH2? I need to do the same..

Thanks very much,
simran
Back to top
View user's profile Send private message
bower5932
PostPosted: Mon Mar 21, 2005 5:55 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

I thought that I read somewhere that you were only allowed simple (ie, one level) of headers in the usr folder.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
vmurali_au
PostPosted: Wed Mar 30, 2005 12:38 am    Post subject: Reply with quote

Voyager

Joined: 26 Mar 2004
Posts: 76

Bower is right. You are allowed to use only simple elements (no grouping) inside the "usr" folder.
It is mentioned in "Programming Guide" of MQSI.
Back to top
View user's profile Send private message
Tibor
PostPosted: Wed Apr 13, 2005 12:44 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

UP!

I use RFH2 frequently but I'm a newbie in JMS. I can handle grouping in the usr folder with the broker, that's why I wonder the paragraph in the manual referenced by vmurali:
Quote:
The content model of the <usr> folder is as follows:
- Any valid XML name can be used as an element name, providing that it doesn’t contain a colon
- Only simple elements, not groups, are allowed
- All elements take the default type of string, unless modified by a dt="xxx" attribute
- All elements are optional, but should occur no more than once in a folder


In this case I have two possibility:
(1) writing to usr folder with a special selector
(2) writing a customized folder in JMS

My problems:
(1): not all XML names are working with setstringproperty() ! I tried hyphen, point,...
(2): how can I build a custom folder in JMS?

TIA,

Tibor
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Apr 13, 2005 4:26 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Flatten/unmarshal your XML and then put that as a single string in the /usr folder.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Tibor
PostPosted: Wed Apr 13, 2005 6:22 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

I *can* flat the usr tags... but I was an idea about enterprise standard for usr folders with application specific tags, namely application-area, eg:
Code:
<usr>
 ...
 <application-area>
   <filename>xxx.zzz</filename>
   ...
  </application-area>
</usr>


Ok, I drop this because it is not allowed by manual. But sending messages throw exception when I try a workaround:
msg.setStringProperty("applicationarea.filename","filename");

Another question was how can I implement this in JMS:
Quote:
Independent software vendors can choose other names for their folders. However, to avoid naming problems, we recommend that vendors prefix their chosen folder name with their internet domain name; for example, a vendor with domain name ourcompany.com might name its folders:
com.ourcompany.xxx or com.ourcompany.ourData


Tibor
Back to top
View user's profile Send private message
linkx
PostPosted: Wed Dec 05, 2007 10:19 am    Post subject: Reply with quote

Newbie

Joined: 05 Dec 2007
Posts: 1

Any news how to put nested tags in <usr>?
I've got same problems. The broker aspects a nested xml
structure....
I'm writing a java program to solve this. I only can fix
it with native MQ library and com.ibm.mq.MQMessage
With JMS it is not possible....any sugestions because
i would like to use JMS and Spring
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Dec 05, 2007 4:41 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Tibor wrote:
I *can* flat the usr tags... but I was an idea about enterprise standard for usr folders with application specific tags, namely application-area, eg:
Code:
<usr>
 ...
 <application-area>
   <filename>xxx.zzz</filename>
   ...
  </application-area>
</usr>


Tibor

Have you tried following?
msg.setStringProperty("application-area","<filename>xxx.zzz</filename>"); ??
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Setting Group properties in MQRFH2
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.