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 » Help with syntax using the Java Compute Node

Post new topic  Reply to topic
 Help with syntax using the Java Compute Node « View previous topic :: View next topic » 
Author Message
goldym
PostPosted: Mon Aug 14, 2006 7:34 am    Post subject: Help with syntax using the Java Compute Node Reply with quote

Centurion

Joined: 24 Jun 2005
Posts: 116

I am trying to figure out the syntax for checking if MQRFH2 header exists and if it does setting it to null in order to remove it, but I am not a java programmer and I am having difficulty using the documentation.

Does anyone have any suggestions or recommednations. This is what I have so far. Is this correct?

MbElement root = assembly.getMessage().getRootElement(); // get MQMD
MbElement rfh2 = root.getFirstElementByPath("/MQRFH2");

if (rfh2!= null) {




}
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Aug 14, 2006 7:42 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

MQRFH2 is going to be a sibling of MQMD, and not a child.

You can tell if there is an MQRFH2 because the MQMD.Format field should be MQFMT_MQRFH2 or some such.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
goldym
PostPosted: Mon Aug 14, 2006 7:55 am    Post subject: Reply with quote

Centurion

Joined: 24 Jun 2005
Posts: 116

[quote="jefflowrey"]MQRFH2 is going to be a sibling of MQMD, and not a child.

You can tell if there is an MQRFH2 because the MQMD.Format field should be MQFMT_MQRFH2 or some such.[/quote]


Do you know how I would set it to null any ideas on the syntax?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Aug 14, 2006 7:57 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I think you just set it = null...
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Aug 14, 2006 1:10 pm    Post subject: Reply with quote

Grand High Poobah

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

jefflowrey wrote:
I think you just set it = null...
Remember the way headers work. Each will contain information about the data that comes after it whether it be payload or another header.

So just setting it to null won't do the trick. What about the format, ccsid and encoding fields of the previous header that are now outdated?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Mon Aug 14, 2006 1:14 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Well, sure, you do need to fix the rest of the message. But goldym only asked about how to delete the MQRFH2...
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
goldym
PostPosted: Tue Aug 15, 2006 10:10 am    Post subject: Reply with quote

Centurion

Joined: 24 Jun 2005
Posts: 116

[quote="jefflowrey"]Well, sure, you do need to fix the rest of the message. But goldym only asked about how to delete the MQRFH2... [/quote]



Thanks to you both!
I used the java detach method and then I changed the MQMD.Format so that it would no longer say "MQHRF2".


rfh2 = outRoot.getFirstElementByPath("MQRFH2");


if (rfh2 != null) {
rfh2.detach();
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 » Help with syntax using the Java Compute 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.