Author |
Message
|
krisrock |
Posted: Wed Nov 21, 2007 10:23 am Post subject: how to avoid restarting app server.... |
|
|
Acolyte
Joined: 11 Sep 2007 Posts: 65
|
This is regarding MQ fail over set up.
I have 2 queue managers residing on 2 different boxes.
The application connects thro' one of them using one property file. (In the file we have the host name, qmgr name, port and channel)
When one of the queue manager fails, it needs to connect to the other queue manager.
We are planning this implementation thro' OS level clustering.
This will help us in having a central store for the queues and also it will give a virtual IP to which the app can connect.
Even in this case, when one queue manager fails, the app has to be restarted, since the tcp connection to the queue manager breaks.
I want to avoind the app server restart, has anyone implemented such a scheme.
Give me ur views... |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Nov 21, 2007 11:27 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
There is no way around this. How could there be? If you lost your connection you need to reconnect! What you should do is code reconnect logic in the application. Having to restart the whole app just to reconnect after a temporary outage is silly.
Code: |
'**********************************************
' This section determines how quickly we try to reconnect
' Try the 1st 5 times 1 second apart
' the 2nd 5 times 2 seconds apart
' the 3rd 5 times 5 seconds apart
' the 4th 5 times 10 seconds apart
' every 60 seconds forever after that
'**********************************************
If retryCounter > 20 Then
sleepInterval = 60000
Else
If retryCounter > 15 Then
sleepInterval = 10000
Else
If retryCounter > 10 Then
sleepInterval = 5000
Else
If retryCounter > 5 Then
sleepInterval = 2000
Else
sleepInterval = 1000
End If
End If
End If
End If
'**************************************************
' Connect to the Queue Manager
'**************************************************
If retryCounter > 0 Then
PrintToScreen("Waiting " & sleepInterval & " milliseconds before trying to reconnect.", False)
System.Threading.Thread.Sleep(sleepInterval)
End If
myQM = New MQQueueManager(ComboBoxQMName.Text, myHashTable)
|
_________________ Peter Potkay
Keep Calm and MQ On
Last edited by PeterPotkay on Mon Nov 26, 2007 10:38 am; edited 1 time in total |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Nov 21, 2007 12:44 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Another way to look at this and that doesn't involve hardware clustering is using a channel table for the connection. Read the client manual... _________________ MQ & Broker admin |
|
Back to top |
|
 |
krisrock |
Posted: Mon Nov 26, 2007 7:32 am Post subject: |
|
|
Acolyte
Joined: 11 Sep 2007 Posts: 65
|
can I have a link for the manual? |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 26, 2007 7:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
krisrock wrote: |
can I have a link for the manual? |
Push the "Repository" button at the top of this page. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
krisrock |
Posted: Mon Nov 26, 2007 8:40 am Post subject: |
|
|
Acolyte
Joined: 11 Sep 2007 Posts: 65
|
Okie...If I use client connection channel and configure the client connection table. Will it avoid restarting the application server?
Becos here again, for fail over, we will have a connection failure.
Will it require an app server restart to work with the new connection? |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 26, 2007 8:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
krisrock wrote: |
Will it require an app server restart to work with the new connection? |
Not if you use the kind of reconnection logic Peter suggested further up. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
krisrock |
Posted: Mon Nov 26, 2007 9:30 am Post subject: |
|
|
Acolyte
Joined: 11 Sep 2007 Posts: 65
|
hmm...
My team doesnot wanna change the code
 |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Nov 26, 2007 9:34 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If the app only attempts to connect at application startup, then the only way to get it to reconnect is to restart the application.
If the app team doesn't want to change that, then you have to restart the app server.
If you don't want to restart the app server, the app team needs to change that. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|