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 » WebSphere Message Broker (ACE) Support » Not able to create properties folder properly

Post new topic  Reply to topic
 Not able to create properties folder properly « View previous topic :: View next topic » 
Author Message
chaita30
PostPosted: Tue Jun 10, 2014 3:36 am    Post subject: Not able to create properties folder properly Reply with quote

Newbie

Joined: 03 Jun 2014
Posts: 7

Not able to create properties folder using this code! When ever such message is passed to RCD it fails with an error "Message has no properties folder"

Code:
MbMessage inMessage = contact admin.getMessage();
      MbMessageAssembly outAssembly = null;
      try {
         // create new message as a copy of the input
         MbMessage outMessage = new MbMessage(inMessage);
         outAssembly = new MbMessageAssembly(contact admin, outMessage);
         
         MbMessage outMbMessage = outAssembly.getMessage();
         MbElement outRootElement = outMbMessage.getRootElement();
         
         MbElement outProperties = outRootElement.getFirstElementByPath("Properties");
         MbElement outPayloadMessage = outRootElement.getLastChild();
         
         if(outProperties == null){
            outProperties = outRootElement.createElementAsFirstChild(50331648, "Properties", null);
            outProperties.createElementAsLastChild(50331648,"MessageSet",BrokerConstants.EMPTY_STRING);
            outProperties.createElementAsLastChild(50331648,"MessageType",BrokerConstants.EMPTY_STRING);
            outProperties.createElementAsLastChild(50331648,"MessageFormat",BrokerConstants.EMPTY_STRING);
            outProperties.createElementAsLastChild(50331648,"Encoding","546");
            outProperties.createElementAsLastChild(50331648,"CodedCharSetId","437");
            outProperties.createElementAsLastChild(50331648,"Transactional",true);
            outProperties.createElementAsLastChild(50331648,"Persistence",true);
            
            SimpleDateFormat l_format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
            java.util.Calendar cal = Calendar.getInstance(new SimpleTimeZone(0,
                  "GMT"));
            l_format.setCalendar(cal);
            Date l_date = new Date();
            String l_currentDate = l_format.format(l_date);
            
            outProperties.createElementAsLastChild(50331648,"CreationTime",l_currentDate);
            outProperties.createElementAsLastChild(50331648,"ExpirationTime",-1);
            outProperties.createElementAsLastChild(50331648,"Priority",0);
            outProperties.createElementAsLastChild(50331648,"ReplyProtocol","MQ");
         }


Please Help!
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Tue Jun 10, 2014 3:39 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Did you try putting a trace node before the RCD node and setting the output of the trace to ${Root} ?

This may prove very informative.
_________________
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
Esa
PostPosted: Tue Jun 10, 2014 4:20 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

This creates a Properties parser:

Code:
outProperties = outRootElement.createElementAsFirstChild( "Properties");


This creates something else:
Code:
outProperties = outRootElement.createElementAsFirstChild(50331648, "Properties", null);
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jun 10, 2014 5:26 am    Post subject: Reply with quote

Grand High Poobah

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

You should really try using the constant names instead of their values...

The same way
Code:
outRootElement.createElementAsFirstChild(MbProperties.PARSER_NAME);

should create the proper parser folder for properties...
I figure what you used in your create arguments was
MbElement.TYPE, "Properties",null . This would not create the folder with the right parser...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Esa
PostPosted: Tue Jun 10, 2014 6:31 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

fjb_saper wrote:
You should really try using the constant names instead of their values...

The same way
Code:
outRootElement.createElementAsFirstChild(MbProperties.PARSER_NAME);



Exactly, but while MbProperties class doesn't exist you will have to use "Properties" string...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Not able to create properties folder properly
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.