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 remove MQMD header within MbMessageAssembly

Post new topic  Reply to topic
 How to remove MQMD header within MbMessageAssembly « View previous topic :: View next topic » 
Author Message
Mohit Gupta
PostPosted: Wed Nov 17, 2004 10:35 pm    Post subject: How to remove MQMD header within MbMessageAssembly Reply with quote

Apprentice

Joined: 16 Sep 2004
Posts: 34

Hi,

I have written a java plugin custom node which extends MbNode and implements MbNodeInterface. In the evaluate method i am getting the bytes of the message MbMessage msg = arg0.getMessage();
byte[] bitstream = msg.getBuffer();
then i pass this byte array or write it out to the output device but i get some characters on the first line definitely its the message header . I want to skip the message header only message body how do i achieve that.

Cheers,
Mohit
Back to top
View user's profile Send private message
kishoreraju
PostPosted: Thu Nov 18, 2004 4:44 am    Post subject: Reply with quote

Disciple

Joined: 30 Sep 2004
Posts: 156

why don't you try to make them Null before coming to the plugin node.is thre any problem to do like this


OutputRoot.MQMD=null;
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Nov 18, 2004 12:39 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Your MessageBuffer will include Properties, MQMD and Data sections. In your plug-in node you need to first get a reference to "Data" part and then create a bitstream out of it.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Mohit Gupta
PostPosted: Thu Nov 18, 2004 9:45 pm    Post subject: Reply with quote

Apprentice

Joined: 16 Sep 2004
Posts: 34

Kishore if i set the OutputRoot.Properties and OutputRoot.MQMD to NULL then broker is throwing an exception and i want to extract some info from the message header like timestamp , filename , batch id etc.
So i have to first read mqmd extract some info and then pass the data alongwith the info from MQMD.

Kirani that's the problem i am facing how to extract Properties , MQMD and Data part out of the buffer. if you see the evaluate method it accepts MbMessageAssembly which gives four methods getExceptionList , getLocalEnvironment , getGlobalEnvironment and getMessage. within getMessage i got the entire message containing Properties and MQMD , now assembly.getMessage returns Message object which doesn't give the methods to extract Properties and MQMD.

Although i manage to do in a dirty way like this..
public void evaluate(MbMessageAssembly arg0, MbInputTerminal arg1)
throws MbException {
MbMessage msg = arg0.getMessage();
byte[] msgdata = msg.getBuffer();
String data = new String(msgdata);
// starting point of my data
int pos = data.indexOf("1,");
data = data.substring(pos);
byte[] bitstream = data.getBytes();
}

Cheers,
Mohit
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Nov 18, 2004 11:41 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Yes, it does. You have to use MbElement class. You can search an element by name also.
Take a look at the sticky on the top of this forum. You will find links to some very good Redbooks, which explain plug-in nodes at very detailed level. They also provide some sample code.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
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 remove MQMD header within MbMessageAssembly
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.