Author |
Message
|
pasupulathisp |
Posted: Tue Apr 28, 2009 12:51 pm Post subject: MQ failover information |
|
|
Novice
Joined: 28 Apr 2009 Posts: 23
|
Hi,
I am trying to run some loading balancing and fail over mechanism on MQ series.I tried to configure a Queue on two QM's and created a MQ Cluster.I tried to put messages on the queue and i was able to see them equally distributed.But when i try to test the failover,by stopping one of the QM's,I am not able to retrieve the messages which are on that QM.
If one of the QM in the cluster is down,is it that we can't get the messages back?I guess the other QM in the cluster must be able to serve this process.
Please advice me on this...
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Tue Apr 28, 2009 1:17 pm Post subject: Re: MQ failover information |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pasupulathisp wrote: |
If one of the QM in the cluster is down,is it that we can't get the messages back? |
It is indeed that.
pasupulathisp wrote: |
I guess the other QM in the cluster must be able to serve this process. |
No it mustn't.
There are any number of discussions on this forum (which the search facility will turn up) as to why WMQ is unsuitible for high availability / failover solutions; most of those discussions centre round this "stuck message" issue, where messages delivered to the failed queue manager are inaccessable.
If you want to do load balancing, use a WMQ cluster. If you want failover, use high availability software. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Tue Apr 28, 2009 1:17 pm Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
You have to do more to allow processing of the messages that are on the downed QM.
You need to have the messages stored on some shared storage and then bring the QM process back up (most likely on a separate box).
Have a look at support pack MC91 and HACMP. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Apr 28, 2009 1:22 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
I should probably emphasise that it's perfectly plausible (and common) to combine the concepts of load balancing & fail over, by protecting a queue manager which participates in a cluster with a high availability solution.
The 2 concepts are by no means exclusive. Just wanted to make that clear. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
pasupulathisp |
Posted: Wed Apr 29, 2009 8:00 am Post subject: MQ failover information |
|
|
Novice
Joined: 28 Apr 2009 Posts: 23
|
Hi,
Thanks for your response.
I modified the Default Persistance property for Queue of QM1 to persist.So,when i sent msgs from the QM2 to QM1( both in the cluster) and then Stop & restart the QM1 i can still see the messages on that particular Queue.And when QM1 is down if i try to send messages from QM2,it still sends messages to QM1 rather than consuming all the incoming messages itself.Is it because that i am send the messages between QM's rather than using some QM3,which has transmission Queue defined.
How does transmission Queue should be configured,such a way that it can communicate between QM1 & QM2(cluster)?
I tried to create QM3 with transmission Queue and tried to add QM3 to the cluster.I am not sure if QM3 has to be inside or outside the cluster.
Thanks in advance.. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Apr 29, 2009 9:06 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You are very very lost and grabbing at straws inappropriately.
All of the following things are completely separate and unreleated in MQ.
1) Cluster workload balancing
2) High availability
3) Message Persistance
Any problems you have with any of these can not be solved by changing anything on the others.
Of these three things, Message Persistance is the easist to understand - so you should go back and read about the "DEFPSIST" value that you have randomly changed- and then decide if you really want to be using Default Persistance.
Once you have grasped this concept, you should then go look at the previously mentioned SupportPacs that discuss High Availability, and learn that well enough that you can achieve that with a single queue manager.
Then you can spend time learning MQ Clustering, and learn about Cluster Name Resolution and Binding. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 29, 2009 10:35 am Post subject: Re: MQ failover information |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
I must agree with mqjeff here:
pasupulathisp wrote: |
I modified the Default Persistance property for Queue of QM1 to persist. |
This has nothing to do with clustering, and may not actually change the persistence of the message.
pasupulathisp wrote: |
So,when i sent msgs from the QM2 to QM1( both in the cluster) and then Stop & restart the QM1 i can still see the messages on that particular Queue. |
Yes. And?
pasupulathisp wrote: |
And when QM1 is down if i try to send messages from QM2,it still sends messages to QM1 rather than consuming all the incoming messages itself.Is it because that i am send the messages between QM's rather than using some QM3,which has transmission Queue defined. |
No.
pasupulathisp wrote: |
How does transmission Queue should be configured,such a way that it can communicate between QM1 & QM2(cluster)? |
Don't create transmission queues and channels between members of a cluster unless there's a very, very good reason. There is seldom such a reason.
pasupulathisp wrote: |
I tried to create QM3 with transmission Queue and tried to add QM3 to the cluster.I am not sure if QM3 has to be inside or outside the cluster. |
This has nothing to do with your original post, and is explained in the Clustering manual. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
pasupulathisp |
Posted: Wed Apr 29, 2009 11:11 am Post subject: MQ failover information |
|
|
Novice
Joined: 28 Apr 2009 Posts: 23
|
Thanks for the reply mqjeff and Vitor.
I will definitely go over your suggestions.Before doing some reading i would like to add one more question.
I heard that if we are trying to get messages from a MQ cluster and one of the QM's are down,the messages on that QM will be transmitted to the other QM's in the cluster.(sori,if it sounds like my initial question,but i would like to be clear)
Thanks for your advices.. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Apr 29, 2009 11:12 am Post subject: Re: MQ failover information |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
pasupulathisp wrote: |
I heard that if we are trying to get messages from a MQ cluster and one of the QM's are down,the messages on that QM will be transmitted to the other QM's in the cluster. |
No. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Apr 29, 2009 8:45 pm Post subject: Re: MQ failover information |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
pasupulathisp wrote: |
Thanks for the reply mqjeff and Vitor.
I will definitely go over your suggestions.Before doing some reading i would like to add one more question.
I heard that if we are trying to get messages from a MQ cluster and one of the QM's are down,the messages on that QM will be transmitted to the other QM's in the cluster.(sori,if it sounds like my initial question,but i would like to be clear)
Thanks for your advices.. |
May be with WebSphere Application Server using the S.I. BUS JMSEngine and a DB persistency store.
Not with WebSphere MQ.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 29, 2009 11:45 pm Post subject: Re: MQ failover information |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pasupulathisp wrote: |
I heard that if we are trying to get messages from a MQ cluster and one of the QM's are down,the messages on that QM will be transmitted to the other QM's in the cluster. |
Wherever you heard that should not be trusted as a source of information. That is absolutely not the case (to be clear).
Continuing the clarity:
- You don't get messages from a MQ cluster; you get them from a MQ queue manager. It's irrelevant if the queue manager participates in a cluster in this context. It's not possible (to forestall your next question) to connect an application to a cluster.
- It is true that if you have a cluster of 3 queue managers A, B & C that all receive messages in a cluster, and A goes down, that messages will stop being delivered to A and all messages will go to B & C. Any messages already delivered (or tagged for delivery) to A are stuck as you've discovered. You'll also find some interesting debates in here on how long it takes the cluster to realise A is down & stop trying to deliver messages to it.
I trust this is now completely clear. If you could post where you heard messages off cluster queue managers when they crash, I'll see to their trouting.....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
sumit |
Posted: Thu Apr 30, 2009 12:22 am Post subject: Re: MQ failover information |
|
|
Partisan
Joined: 19 Jan 2006 Posts: 398
|
pasupulathisp, probably you heard this...
Vitor wrote: |
- It is true that if you have a cluster of 3 queue managers A, B & C that all receive messages in a cluster, and A goes down, that messages will stop being delivered to A and all messages will go to B & C. Any messages already delivered (or tagged for delivery) to A are stuck as you've discovered. You'll also find some interesting debates in here on how long it takes the cluster to realise A is down & stop trying to deliver messages to it. |
but understood this...
pasupulathisp wrote: |
I heard that if we are trying to get messages from a MQ cluster and one of the QM's are down,the messages on that QM will be transmitted to the other QM's in the cluster. |
_________________ Regards
Sumit |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Apr 30, 2009 5:51 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
This might help:
All MQGETs are local; that is, your application must MQCONNect to a qmgr where a local instance of the queue with messages exists. All MQCONNects are local, as well; that is, your application must MQCONNect to a qmgr in the same instance of the o/s. (yes, the WMQ Client is an exception.)
It makes no difference if the local queue is clustered or not - clustering is about MQPUTs, not MQGETs _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
pasupulathisp |
Posted: Thu Apr 30, 2009 6:47 am Post subject: |
|
|
Novice
Joined: 28 Apr 2009 Posts: 23
|
Thanks Vitor & fjb_saper,
Yes,i should have been more clear about MQ Cluster and MQ Queue Manager.But i do understand that if any QM in a MQ Cluster is DOWN,the messages will not be delivered to that QM until its back up and running.
Now i am trying to put a message on Queue through a Servlet.I am able to read and write messages to the Queue,if i have the hostName,port,channel,qmgr and qName.But when i try to use a JNDI lookup i am having some exception,both MQ and Weblogic are on local. (and later i would like to connect remote MQ through JNDI.)I tried to look at some code through the sample code link in this forum,but looks like its broken.
Code: |
String queueName = "java:comp/env/jms/WLMMyReplyQueue";
jndiContext = new InitialContext();
queueConnectionFactory = (QueueConnectionFactory) jndiContext.lookup("java:comp/env/jms/WLSenderQCF");
|
Here is the exception
Quote: |
javax.naming.NameNotFoundException: While trying to look up comp/env/jms/WLSenderQCF in /app/webapp/WebContent/5333825.; remaining name 'comp/env/jms/WLSenderQCF'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(Ljava/lang/String;Ljava/lang/String;Ljava/util/Hashtable;)Ljavax/naming/NameNotFoundException;(BasicNamingNode.java:924)
at weblogic.jndi.internal.ApplicationNamingNode.lookup(Ljava/lang/String;Ljava/util/Hashtable;)Ljava/lang/Object;(ApplicationNamingNode.java:150)
at weblogic.jndi.internal.WLEventContextImpl.lookup(Ljavax/naming/Name;Ljava/lang/String;)Ljava/lang/Object;(WLEventContextImpl.java:256)
at weblogic.jndi.internal.WLContextImpl.lookup(Ljava/lang/String;)Ljava/lang/Object;(WLContextImpl.java:363)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(Ljava/lang/String;)Ljava/lang/Object;(ReadOnlyContextWrapper.java:45)
at weblogic.jndi.internal.AbstractURLContext.lookup(Ljava/lang/String;)Ljava/lang/Object;(AbstractURLContext.java:130)
at javax.naming.InitialContext.lookup(Ljava/lang/String;)Ljava/lang/Object;(InitialContext.java:347)
at com.medplus.test.MqServlet.putMessage()V(MqServlet.java:50)
at com.medplus.test.MqServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(MqServlet.java:37)
at javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava/lang/Object;(ServletStubImpl.java:1072)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/FilterChainImpl;)V(ServletStubImpl.java:465)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(ServletStubImpl.java:348)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;(WebAppServletContext.java:6981)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic/security/subject/AbstractSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.contact admin(Lweblogic/security/acl/internal/AuthenticatedSubject;Lweblogic/security/acl/internal/AuthenticatedSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponseImpl;)V(WebAppServletContext.java:3892)
at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic/kernel/ExecuteThread;)V(ServletRequestImpl.java:2766)
at weblogic.kernel.ExecuteThread.execute(Lweblogic/kernel/ExecuteRequest;)V(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:183)
at java.lang.Thread.startThreadFromVM(Ljava/lang/Thread;)V(Unknown Source) |
On the Weblogic Server (Version 8 ),i defined the Local JNDI Name =jms/WLSenderQCF under foreign JMS Connection Factory and jms/WLMyReplyQueue under Foreign JMS Destination.
Please advice if i am missing any configurations.
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Thu Apr 30, 2009 7:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pasupulathisp wrote: |
i do understand that if any QM in a MQ Cluster is DOWN,the messages will not be delivered to that QM until its back up and running. |
Might not be delivered. Well, will not be delivered because the target QM is down but might not be delivered to any other queue managers eiterh.
pasupulathisp wrote: |
Now i am trying to put a message on Queue through a Servlet.I am able to read and write messages to the Queue |
I don't see the connection to your original post, and wonder if this would not be better as a new thread.
In any event, well out of my area of expertise and I'll leave responses to the better qualified. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|