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 » Setting MQMD ApplIdentityData in java Compute Node .

Post new topic  Reply to topic
 Setting MQMD ApplIdentityData in java Compute Node . « View previous topic :: View next topic » 
Author Message
binayak.nanda
PostPosted: Sat Nov 01, 2014 11:08 pm    Post subject: Setting MQMD ApplIdentityData in java Compute Node . Reply with quote

Novice

Joined: 29 Oct 2014
Posts: 17

Hi All ,
I am new to IIB v9.0 . I am facing a problem that in a java compute node i am generating a reference id of integer . I want to pass that id to all the flows . I want to set it in MQMD ApplIdentityData field . In my message MQMD does not exist as I am getting null when i am calling outMessage.getRootElement().getFirstElementByPath(
"MQMD/ApplIdentityData") . I have to create MQMD and set ApplIdentityData field to that number . I have done like this

MbElement root = outMessage.getRootElement();
MbElement mqmd = root.createElementAsFirstChild("MQMD");
MbElement appIdentityData = mqmd.createElementAsFirstChild(
MbElement.TYPE_NAME_VALUE, "ApplIdentityData", refId);

It is not working . I have done wrong here . Please suggest me how to set refId to ApplIdentityData of MQMD .

Thanks,
Binayak
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Nov 01, 2014 11:38 pm    Post subject: Reply with quote

Grand High Poobah

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

You do realize that the application identity may not be the first field of the MQMD. Why don't you use an MQHeader node to set the MQMD? You can then retrieve the application identity data and set it. Don't forget to look at the flags to allow the set appid data. Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
binayak.nanda
PostPosted: Mon Nov 03, 2014 11:45 pm    Post subject: Reply with quote

Novice

Joined: 29 Oct 2014
Posts: 17

I added MQHeader Node and create ApplIdentityData field as first child as initially it was not there in properties and populated data to it . It successfully worked in the same flow throughout . But when next flow starts ApllIdentityData is changed to blank and also its location changed in MQMD tree .Initially i created in 1st location of MQMD Tree. I think a new MQMD created for that flow . I need that data to be there in ApplIdentityData field throughout all flows . Please suggest how to do .

Thanks,
Binayak
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Nov 04, 2014 6:11 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You need to accept that the MQMD is a fixed-length structure with fields in a specific order.

You need to accept that the MQMD parser in IIB will serialize and parse the MQMD properly.

And so you should always access fields under the MQMD by name, not by position.

You need to understand how and under what conditions MQ lets you modify various fields under the MQMD based on the options used when you PUT the message.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Nov 04, 2014 6:12 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

binayak.nanda wrote:
But when next flow starts ApllIdentityData is changed to blank and also its location changed in MQMD tree .


The fields in an MQMD are of fixed length and fixed position, and the ApplIdentityData is never the first field. The MQMD is a message descriptor, so when you start a new flow (with a new message) you get a new MQMD.

binayak.nanda wrote:
Initially i created in 1st location of MQMD Tree.


Wrong move - see above.

binayak.nanda wrote:
I think a new MQMD created for that flow .


Yes - see above

binayak.nanda wrote:
I need that data to be there in ApplIdentityData field throughout all flows . Please suggest how to do .


Store it external to your flows and add it to each new message.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Nov 04, 2014 9:18 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Use the MQHeader node as suggested.

Avoid coding whenever possible, especially in Java! ESQL is much better.

The entire point of WMB or IIB is to gain development efficiency by not coding (much). If you want an application server, there is WAS.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
martinb
PostPosted: Wed Nov 05, 2014 1:37 am    Post subject: Reply with quote

Master

Joined: 09 Nov 2006
Posts: 210
Location: UK

binayak.nanda wrote:
I added MQHeader Node and create ApplIdentityData field ... It successfully worked in the same flow throughout . But when next flow starts ApllIdentityData is changed to blank ... I need that data to be there in ApplIdentityData field throughout all flows . Please suggest how to do .

Thanks,
Binayak


If you want to have a Message Flow MQOutput node to be passing specific ApplIdentityData and other context values you need to be looking at setting the MQOutput node options such as "Message Context" or "Alternate User Authority".
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 » Setting MQMD ApplIdentityData in 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.