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 IndexWebSphere Message Broker SupportGetting Queue Name property in Java Compute Node

Post new topicReply to topic
Getting Queue Name property in Java Compute Node View previous topic :: View next topic
Author Message
DevNYC1
PostPosted: Thu Apr 06, 2017 12:05 pm Post subject: Getting Queue Name property in Java Compute Node Reply with quote

Apprentice

Joined: 22 Aug 2012
Posts: 30

I have a Java Compute Node and would like to get access to the QueueName (queueName) property of MQInput node this is connected to this Java Compute Node?

I.e., what to know at run time what queue sent the message to this JavaCompute node.

Is this possible? I searched extensively in the IBM documentation and online, including this forum, and cannot find any information on this.

Thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Apr 06, 2017 12:32 pm Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24330
Location: Ohio, USA

In ESQL it's in the MQMD domain of the message tree under SourceQueue.

Lord alone knows what that is in Java.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
adubya
PostPosted: Thu Apr 06, 2017 12:34 pm Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 366
Location: GU12, UK

Interrogate the MQMD of the input message ?

Code:

   public void evaluate(MbMessageAssembly assembly) throws MbException {
      // --------------------------------------------------------------
      // output terminals
      // --------------------------------------------------------------
      MbOutputTerminal out = getOutputTerminal("out");
      MbOutputTerminal alt = getOutputTerminal("alternate");

      // --------------------------------------------------------------
      // get root element
      // --------------------------------------------------------------
      MbElement root = assembly.getMessage().getRootElement();

      // --------------------------------------------------------------
      // get queue name from MQMD
      // --------------------------------------------------------------
           String queueName = root.getFirstElementByPath(
            "/MQMD/SourceQueue").getValue().toString()
..
..
..

_________________
Independent Middleware Consultant
andy@knownentity.com


Last edited by adubya on Thu Apr 06, 2017 12:37 pm; edited 3 times in total
Back to top
View user's profile Send private message Send e-mail
DevNYC1
PostPosted: Thu Apr 06, 2017 12:34 pm Post subject: Reply with quote

Apprentice

Joined: 22 Aug 2012
Posts: 30

This is wonderful, guys. I will try.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportGetting Queue Name property 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.