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 » Retrieving server name at run time

Post new topic  Reply to topic
 Retrieving server name at run time « View previous topic :: View next topic » 
Author Message
MbRick
PostPosted: Mon Feb 09, 2009 1:18 pm    Post subject: Retrieving server name at run time Reply with quote

Newbie

Joined: 09 Feb 2009
Posts: 3

Hello All,
I am trying to retrieve the servername / hostname from within a message flow. This is the Windows server name, not the Broker name. Any method using ESQL or Java in a compute node would work.
Thanks,
WMB v6.1.0, Windows Server 2003
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Feb 09, 2009 3:21 pm    Post subject: Re: Retrieving server name at run time Reply with quote

Grand High Poobah

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

MbRick wrote:
I am trying to retrieve the servername / hostname from within a message flow.


The question is, what's the requirement? If it's just environmental information probably better expressed as a UDP at deploy time.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
MbRick
PostPosted: Mon Feb 09, 2009 5:18 pm    Post subject: Reply with quote

Newbie

Joined: 09 Feb 2009
Posts: 3

The requirement is to create a log record indicating time, date, server name, tracking id, and message body. This record is part of an existing tracing and diagnostic process used to monitor transactions being processed through a middleware application. The system has numerous brokers in the transformation layer and we need to know (using the server name in the tracelog record) what specific server processed the message.

I was hoping that the server name or host name was available as part of the environment tree at run time. I have seen code to retrieve the broker name, but not the server name. I have been searching the PDF manuals, redbooks and forums to no avail. You would think it would be an available property or variable accessible from the message flow.

Any help would be greatly appreciated. Thanks.
Back to top
View user's profile Send private message
MQEnthu
PostPosted: Mon Feb 09, 2009 8:09 pm    Post subject: Reply with quote

Partisan

Joined: 06 Oct 2008
Posts: 329
Location: India

You can either use UDP as sugested by Vitor... set the server name before deploying. So that you can get the the server name for logging.

Otherwise, if I understand your scenario correctly,you have set of brokers (or each broker) associated with one server. Get the broker name dynamically and look for the corresponding server name.
_________________
-----------------------------------------------
It is good to remember the past,
but don't let past capture your future
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Feb 09, 2009 8:49 pm    Post subject: Reply with quote

Grand High Poobah

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

MbRick wrote:
The requirement is to create a log record indicating time, date, server name, tracking id, and message body. This record is part of an existing tracing and diagnostic process used to monitor transactions being processed through a middleware application. The system has numerous brokers in the transformation layer and we need to know (using the server name in the tracelog record) what specific server processed the message.

I was hoping that the server name or host name was available as part of the environment tree at run time. I have seen code to retrieve the broker name, but not the server name. I have been searching the PDF manuals, redbooks and forums to no avail. You would think it would be an available property or variable accessible from the message flow.

Any help would be greatly appreciated. Thanks.


You are seriously mistaken in the importance you allocate to the host.
The broker name is everything. Through the broker name you should know the host name. What do you do when you have multiple brokers on the same host? And yes this answer is biased as it assumes that you have a well behaved network with no 2 broker names/qmgr names being the same.

Anyways if you really need the host name have you tried the stuff you can get at with java.net...
Code:
InetAddress myaddress = InetAddress.getLocalHost();
String hostname = myaddress.getName(); // = myaddress.getCanonicalName();


Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Mon Feb 09, 2009 11:12 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Or you can use the Suport PAck that gets the environment variables node.....
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
MbRick
PostPosted: Tue Feb 10, 2009 11:32 am    Post subject: Reply with quote

Newbie

Joined: 09 Feb 2009
Posts: 3

Thanks for the replies.

fjb_saper - The straight java code using
Code:
InetAddress addr = InetAddress.getLocalHost();
does the trick for my current needs. If we had the option to add fields to our Tracelog record I could see adding BrokerName, ExecutionGroup and possibly MessageFlowName. Per your comment, this would give us a finer level of detail to help diagnose runtime issues.

smdavies99 - I will investigate the Support Pack option for future needs in where environment variables may be needed when using ESQL code.

Thanks again.
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 » Retrieving server name at run time
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.