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 » Get the Server Name in Flow

Post new topic  Reply to topic Goto page Previous  1, 2, 3
 Get the Server Name in Flow « View previous topic :: View next topic » 
Author Message
lancelotlinc
PostPosted: Wed Feb 01, 2012 10:36 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

kash3338 wrote:
Again, this discussion has gone a long way about the real need of HostName which my ESQL is not able to fetch for me and there are so many supporters for the features offered by ESQL and argue that HostName is of no use and hence it does not come as part of Broker Properties

Agreed it does not make much sense, but the XML that we generate is generic to some many other applications as well and there is a field called Host name in it, which we have to populate from our flow. Thats the only reason and we can remove it if we have to invoke a Java app just to get this info.

I was curious to know if there is way out of Java to achieve this.


Yes, ESQL is able to fetch hostname.

Code:



ESQL:

CREATE PROCEDURE getHostName(  )
  RETURNS CHARACTER
 LANGUAGE JAVA
 EXTERNAL NAME "com.<yourcompanyname>.middleware.common.util.WmbUtils.getHostName";


SET hostname = getHostName();


...


Java:

public static String getHostName()

try
{
java.net.InetAddress localMachine =
java.net.InetAddress.getLocalHost();
return localMachine.getHostName();
}
catch(catch(java.net.UnknownHostException uhe)
{
//handle exception
}



Why are you so stubborn about Java ?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
kamy
PostPosted: Wed Feb 01, 2012 12:37 pm    Post subject: Reply with quote

Novice

Joined: 26 Oct 2001
Posts: 21

We had a similar requirement to populate the hostname in order to interface with HP open-view for error handling and problem management.
Back to top
View user's profile Send private message Send e-mail
kash3338
PostPosted: Thu Feb 02, 2012 7:14 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

lancelotlinc wrote:
Why are you so stubborn about Java ?


I am not stubborn on using Java, infact my current solution is the same as you have posted

Just wanted to know if there is a direct function like Broker Properties from ESQL.
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Fri Feb 03, 2012 7:35 pm    Post subject: Reply with quote

Grand High Poobah

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

I don't understand what the hangup on the hostname is.
Just like mqjeff specified I would have thought that the broker's name or the broker's qmgr name would be the more important information.

Just because the environment the requester comes from asks for a hostname does not mean that it will be the most important information germane to the request processing and troubleshooting.

Imagine using 50 J2EE server instances on 3 boxes. What do you believe will be more important as information: the name of the server instance or the name of the host it resides on?

The same way, the most important information for the flow would be the broker it runs on, the execution group it runs in, the flow name being run...

All this is available at runtime.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqsiuser
PostPosted: Sat Feb 04, 2012 3:07 am    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

I guess the development of ESQL was demand driven (and not like "we put in this hip-language here and this hip-W3C-standard there"). No need for anyone to request the hostname in the early days (or even/probably? good reasons to reject such requests?!).

Use Java. If you have issues open a PMR (as always, just to say "use Java, it is supported!").

Into the field hostname put in the name of where your code is hosted:

Code:
SET hostname = BrokerName + '.' + ExecutionGroupLabel + '.' + MessageFlowLabel;


Then one day operations will come to you and say 'wow this information is so much better than the machine's name!'
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3 Page 3 of 3

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Get the Server Name in Flow
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.