|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Not able to create properties folder properly |
« View previous topic :: View next topic » |
Author |
Message
|
chaita30 |
Posted: Tue Jun 10, 2014 3:36 am Post subject: Not able to create properties folder properly |
|
|
 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 |
|
 |
smdavies99 |
Posted: Tue Jun 10, 2014 3:39 am Post subject: |
|
|
 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 |
|
 |
Esa |
Posted: Tue Jun 10, 2014 4:20 am Post subject: |
|
|
 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 |
|
 |
fjb_saper |
Posted: Tue Jun 10, 2014 5:26 am Post subject: |
|
|
 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 |
|
 |
Esa |
Posted: Tue Jun 10, 2014 6:31 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|