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 » IBM MQ Java / JMS » Regarding MQServer Host name

Post new topic  Reply to topic Goto page 1, 2  Next
 Regarding MQServer Host name « View previous topic :: View next topic » 
Author Message
Rajeshwar
PostPosted: Mon Jun 21, 2010 7:07 am    Post subject: Regarding MQServer Host name Reply with quote

Newbie

Joined: 21 Jun 2010
Posts: 8

Hi All,

We are migrating from MQ6 to MQ7. We are using the TAB file to get the connection to QueueManager.
We are using MQ Java API's. Can any one tell me how to get the host name to which the java client is connected whether primary server or secondary server <host name>? We need to capture it in our log file stating that our java client is currently connected to the <servername> in MQ7.

Thanks in advance,

With Regards
Rajeshwar
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jun 21, 2010 7:51 am    Post subject: Re: Regarding MQServer Host name Reply with quote

Grand High Poobah

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

Rajeshwar wrote:
Can any one tell me how to get the host name to which the java client is connected whether primary server or secondary server <host name>?


Do you mean the primary or standby of a v7 multi-instance queue manager? If not, what do you mean?

Rajeshwar wrote:
We need to capture it in our log file stating that our java client is currently connected to the <servername> in MQ7.


Why? What value does this information have to your application that it would want to log it? What's the requirement here, aside from the usual "we're auditors, log everything"??
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Rajeshwar
PostPosted: Mon Jun 21, 2010 9:46 pm    Post subject: Re: Regarding MQServer Host name Reply with quote

Newbie

Joined: 21 Jun 2010
Posts: 8

Hi,

Thanks for the reply.

Quote:
Do you mean the primary or standby of a v7 multi-instance queue manager? If not, what do you mean?


Yes, it is primary or stand by of v7 multi-instance queue manager. In our java client, If any fail over occurs we are getting an exception with reason code 2009 and we are handling it by again retrying to get new connection to the queue manager. This time we are getting connected to standy server which now works as primary. Now we need to capture the server details like host name and log the server details in our client log file.

Is there any way to get the host name to which our client is connected from Java MQ API?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jun 22, 2010 4:12 am    Post subject: Re: Regarding MQServer Host name Reply with quote

Grand High Poobah

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

Rajeshwar wrote:
In our java client, If any fail over occurs we are getting an exception with reason code 2009 and we are handling it by again retrying to get new connection to the queue manager.


Why not upgrade to the v7 client & use the new facility?

Rajeshwar wrote:
Now we need to capture the server details like host name and log the server details in our client log file.


Again, why? What value does this give? What use is this information?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Rajeshwar
PostPosted: Tue Jun 22, 2010 5:12 am    Post subject: Re: Regarding MQServer Host name Reply with quote

Newbie

Joined: 21 Jun 2010
Posts: 8

Quote:
Why not upgrade to the v7 client & use the new facility?


What is the upgrade we want to do in our java mq client. we have developed our own client with WebSphere MQ classes in Java provided by IBM. we have already got the required jar files and done the modifications for v7.
Here our current requirement is simple. Some times our client will connect to QM present in server1 and some times if failover occurs it will connect to server2 QM. We need to log this information in our log file to which server it is connected. How can we get the server information in the code?
note: We are using TAB file in our code to connect to the QM.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jun 22, 2010 5:18 am    Post subject: Re: Regarding MQServer Host name Reply with quote

Grand High Poobah

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

Rajeshwar wrote:
Here our current requirement is simple. Some times our client will connect to QM present in server1 and some times if failover occurs it will connect to server2 QM. We need to log this information in our log file to which server it is connected. How can we get the server information in the code?
note: We are using TAB file in our code to connect to the QM.


That may be your requirement but it's not the question I'm asking, which is why is there this requirement? It's of no value whatsoever to your application (which only cares if there's a connection not where it is) and for this reason there's no way I'm aware of to obtain it, especially as you're using a TAB file.

Guessing here, but if this is some way of recording that a failover has occured this is a very silly way of doing it. This is why I keep banging on about what you're actually trying to achieve aside from a line in a log file, as there may be a way to achieve this through other means.

But if you're happy to keep asking the same question over & over and ignoring mine, the short answer is you can't.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Rajeshwar
PostPosted: Tue Jun 22, 2010 5:48 am    Post subject: Re: Regarding MQServer Host name Reply with quote

Newbie

Joined: 21 Jun 2010
Posts: 8

Hi,

Thanks for the reply .

Here is the info which you are asking

We are tracking this information only to log and send alert emails that failover happened and the QM switched to other server. This helps us to keep things accordingly.

i have seen the server details in MQ log file which contains the host name also. PFB some log details in the MQlog file.

-------------------------------------------------------------------------------
6/16/2010 12:38:23 - Process(5652.1) User(root) Program(amqzmuc0.exe)
Host(HYDHTC74770D) (Primary server)
AMQ5041: The Queue Manager task 'LOGGER-IO' has ended.

EXPLANATION:
The Queue Manager task LOGGER-IO has ended.
ACTION:
None.
-------------------------------------------------------------------------------
6/16/2010 12:38:23 - Process(1780.1) User(root) Program(amqzxma0.exe)
Host(HYDHTC74770D)
AMQ8004: WebSphere MQ queue manager 'QM4' ended.

EXPLANATION:
WebSphere MQ queue manager 'QM4' ended.
ACTION:
None.


-------------------------------------------------------------------------------
6/16/2010 12:38:16 - Process(4584.1) User(root) Program(runmqchi.exe)
Host(HYDHTC75027D) (Standby server)

AMQ8024: WebSphere MQ channel initiator started.

EXPLANATION:
The channel initiator for queue has been started.
ACTION:
None.
-------------------------------------------------------------------------------
6/16/2010 12:57:42 - Process(6696.1) User(root) Program(amqzxma0.exe)
Host(HYDHTC74770D)
AMQ8060: WebSphere MQ queue manager 'QM4' started as a standby instance.

EXPLANATION:
Queue manager 'QM4' started as a standby instance, ready to become the active
instance if the existing active instance fails.
ACTION:
None.
-------------------------------------------------------------------------------

I am looking like this info from the code. Any way from the reply i understood that it is not possible. Please let me know any other alternative for this. it would be helpful.

Regards,
Rajeshwar
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jun 22, 2010 5:52 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If you see the information you need to create an email alert in the log on the server, why are you trying to get it from your client application that is presumably doing actually business work rather than acting as a monitoring agent?

If the client application you are talking about is actually acting as a monitoring agent... why are you trying to monitor the MQ server from an application running on a different machine?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jun 22, 2010 6:17 am    Post subject: Re: Regarding MQServer Host name Reply with quote

Grand High Poobah

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

Rajeshwar wrote:
We are tracking this information only to log and send alert emails that failover happened and the QM switched to other server. This helps us to keep things accordingly.


Which is part of the server monitoring. Why are you trying to build it into the client?

Rajeshwar wrote:
Please let me know any other alternative for this. it would be helpful.


Use the log information you yourself just posted??
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Rajeshwar
PostPosted: Tue Jun 22, 2010 6:50 am    Post subject: Re: Regarding MQServer Host name Reply with quote

Newbie

Joined: 21 Jun 2010
Posts: 8

Quote:
Use the log information you yourself just posted??

This information will be present in some file system which the java client cant access and can only access by the QM servers.

Quote:
Which is part of the server monitoring. Why are you trying to build it into the client?

Yes its server monitoring, still we need this information as an automated way (via emails if failover occurs), where we cant go to the server log files and check it manually.

Quote:
If you see the information you need to create an email alert in the log on the server, why are you trying to get it from your client application that is presumably doing actually business work rather than acting as a monitoring agent?
If the client application you are talking about is actually acting as a monitoring agent... why are you trying to monitor the MQ server from an application running on a different machine?

Although it is a client application, due to some requirements we need to handle this senario and this scenario occurs only if fail over happens. The log statements are actually from the server log files.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jun 22, 2010 7:34 am    Post subject: Re: Regarding MQServer Host name Reply with quote

Grand High Poobah

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

Rajeshwar wrote:
Yes its server monitoring, still we need this information as an automated way (via emails if failover occurs), where we cant go to the server log files and check it manually.


So (as both I & my most worthy associate have said) are you trying to do this with a remote client?

Rajeshwar wrote:
Although it is a client application, due to some requirements we need to handle this senario and this scenario occurs only if fail over happens. The log statements are actually from the server log files.


For what seems like the 100th time what requirement? Handle what? All I can see is you're trying to send an email when the queue manager fails over. What requirement forces you to use a remote client for this? The only reason I can think of is because you've no authority to run anything on the server side, and if that's the case the question becomes why isn't whoever owns the server doing the montioring?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Rajeshwar
PostPosted: Tue Jun 22, 2010 10:17 pm    Post subject: Re: Regarding MQServer Host name Reply with quote

Newbie

Joined: 21 Jun 2010
Posts: 8

Quote:
So (as both I & my most worthy associate have said) are you trying to do this with a remote client?


Yes we are running remote client.

Anyways, Thanks for the replies you have been giving.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jun 23, 2010 5:58 am    Post subject: Re: Regarding MQServer Host name Reply with quote

Grand High Poobah

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

Rajeshwar wrote:
Quote:
So (as both I & my most worthy associate have said) are you trying to do this with a remote client?


Yes we are running remote client.


And for what I promise is the last time I ask why? Why not a local client?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Rajeshwar
PostPosted: Wed Jun 23, 2010 7:06 am    Post subject: Re: Regarding MQServer Host name Reply with quote

Newbie

Joined: 21 Jun 2010
Posts: 8

Vitor wrote:

And for what I promise is the last time I ask why? Why not a local client?


We have different java end applications which interacts with MQServer and we gave the reusable java mq API put or get options available to the end app.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jun 23, 2010 7:12 am    Post subject: Reply with quote

Grand High Poobah

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


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » Regarding MQServer Host name
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.