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 » How to Create MQMD Header Part Using JavaCompute Node ?

Post new topic  Reply to topic
 How to Create MQMD Header Part Using JavaCompute Node ? « View previous topic :: View next topic » 
Author Message
Ranodip Basu
PostPosted: Wed Apr 04, 2007 1:14 pm    Post subject: How to Create MQMD Header Part Using JavaCompute Node ? Reply with quote

Apprentice

Joined: 23 Sep 2004
Posts: 48

Hi All,

I am using WMB 6.0 and MQ 5.3. In one of our MsgFlow we are getting messages from HTTPInput node and need to put them it in a MQQueue.So to put a queue we need to add a MQMD header in output message and the Java code we have developed for that is in below :

Quote:
MbElement mqmd = outRoot.createElementAfter("MQHMD");
mqmd.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE,"Format","XMLNSC");


as given in toolkit help
Quote:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac30430_.htm


This code actually placing the MQMD as first child of ROOT i.e. before Properties. But as per my knowledge the MQMD should be placed after Properties. So we have modified the code and used as in below:

Quote:
MbElement mqmd = outRoot.getFirstChild().createElementAfter("MQHMD");
mqmd.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE,"Format","XMLNSC");


In MQOutput node properties, we have selected Advanced-> New Message Id to assign a new message Id for output message.

But for both the cases above it not able to put message in queue and giving MQRC 2097 error. Should we need to add anything in MQMD ?

Thanks in advance,
Ranodip
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Wed Apr 04, 2007 11:22 pm    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

use the search button and search for 2097, there are a number of posts which may fit your needs.
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
marcin.kasinski
PostPosted: Thu Apr 05, 2007 4:06 am    Post subject: Re: How to Create MQMD Header Part Using JavaCompute Node ? Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

Place trace node inside flow and check your tree structure.
You will see where the problem is. I hope



Quote:
MbElement mqmd = outRoot.getFirstChild().createElementAfter("MQHMD");
mqmd.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE,"Format","XMLNSC");



PS. Shouldn't it be:

Quote:
MbElement mqmd = outRoot.getFirstChild().createElementAfter("MQMD");
mqmd.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE,"Format","MQSTR");

_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
Ranodip Basu
PostPosted: Thu Apr 05, 2007 9:45 am    Post subject: Reply with quote

Apprentice

Joined: 23 Sep 2004
Posts: 48

Hi Marcin,

While I am using
Quote:
MbElement mqmd = outRoot.getFirstChild().createElementAfter("MQMD");
mqmd.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE,"Format","MQSTR");
the MQMD header is not generating and in the exception list I am getting

Quote:
(0x03000000):Severity = 3
(0x03000000):Number = 2310
(0x03000000):Text = 'Could not create parser'
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'MQMD'


But when I have changed the code to
Quote:
MbElement mqmd = outRoot.getFirstChild().createElementAfter("MQHMD");
mqmd.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE,"Format","MQSTR");


It is still not able to put message in queue and the trace is as in below:

THE HEADER PART:

Quote:
(0x01000000):Properties = (
(0x03000000):MessageSet = ''
(0x03000000):MessageType = ''
(0x03000000):MessageFormat = ''
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 1208
(0x03000000):Transactional = FALSE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2007-04-05 17:27:41.820'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x03000000):ReplyProtocol = 'SOAP-HTTP'
(0x03000000):Topic = NULL
(0x03000000):ContentType = ''
)
(0x01000000):MQMD = (
(0x03000000):Format = 'MQSTR'
)
(0x01000000):XMLNSC = (
(0x01000400):XmlDeclaration = (
(0x03000100):Version = '1.0'
(0x03000100):Encoding = 'UTF-8'


THE EXCEPTION LIST:

Quote:
(0x03000000):Severity = 3
(0x03000000):Number = 2667
(0x03000000):Text = 'Failed to put message'
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '-1'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'MQW102'
)
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '2097'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = ''


Thanks & Regards,
Ranodip
Back to top
View user's profile Send private message
Ranodip Basu
PostPosted: Thu Apr 05, 2007 9:48 am    Post subject: Reply with quote

Apprentice

Joined: 23 Sep 2004
Posts: 48

Hi,

Using ESQL I am able to create a MQMd header from scratch and put the message in queue. The code is as below:

Quote:
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
SET OutputRoot.MQMD.StrucId = MQMD_STRUC_ID;
SET OutputRoot.MQMD.Version = MQMD_CURRENT_VERSION;
SET OutputRoot.MQMD.MsgType = MQMT_DATAGRAM;
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2 ;
SET OutputRoot.XMLNSC = InputRoot.XMLNSC;


But in Java I am not able able to find how to add these values to corressponding MQMd properties ? Are MQMD_STRUC_ID, MQMD_CURRENT_VERSION etc. conatants available in MB Broker java packages ?
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Thu Apr 05, 2007 11:31 am    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

Another example with MQHMD. This is correct name of parser class.

Code:
MbElement root = msg.getRootElement();

    MbElement body = root.getLastChild();
    MbElement mqmd = body.createElementBefore("MQHMD");


You mentioned that it works with ESQL but please check Message Context Arrtibute of MQOutput.

Try "Default".

Is it full message tree you showed us ?
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
Ranodip Basu
PostPosted: Thu Apr 05, 2007 12:09 pm    Post subject: Reply with quote

Apprentice

Joined: 23 Sep 2004
Posts: 48

Hi Marcin,

The problem got splved now. Yes the problem root was with Message Context property of MQOutput node. By default it comes as Pass all which I changed to Set All. So after changing it is working fine even with
Quote:
mqmd.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE,"Format","XMLNSC"
.

Thanks a lot for all of your helps.

Ranodip
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Thu Apr 05, 2007 12:22 pm    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

I forgot about this common problem at first post.
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
amitgoelamit
PostPosted: Sat Jul 19, 2008 1:59 am    Post subject: useful information Reply with quote

Novice

Joined: 19 Jul 2008
Posts: 20

good ! lot of information
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 » How to Create MQMD Header Part Using JavaCompute Node ?
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.