|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQ Cluster Workload balance |
« View previous topic :: View next topic » |
Author |
Message
|
RadhamaniRamadoss |
Posted: Thu Apr 11, 2013 5:15 pm Post subject: MQ Cluster Workload balance |
|
|
Apprentice
Joined: 08 Oct 2009 Posts: 42
|
I have 3 Queue managers.
MB7QMGR is a Partial repository.QM1 and QM2 are Full repositories.
To enact a scenario of Cluster Qoekload balance ,I have a Queue "CLUSTERQ" which has its intance running in all the 3 Queue managers.
I made use of the below java program to put messages in the CLUSTERQ by connecting to MB7QMGR.
When messages are sent,the messages are distributed in round-robin fashion.
Now before putting the message,I shut down the Queue manager.My expection is when the QM is not available,messages should be picked by other QMs in the cluster.But this is not working.I am getting "host not available" error and the error is captured by MQException class.
Is this properly working?Or Am I missing something?
I have MQOO_BIND_NOT_FIXED while MQopen and MQPut.I have Cluster queue property set as Default bind type="Not fixed" and Use Queue="Any".
Please someone help me solve this....
Here is my application connected to MQServer:
public class MQ_Java_put {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String server = "WELCOME-PC"; // The server name
Integer port = new Integer(2414); // The Port the listener is running on
//String user = "USER"; // User name
//String password = "PASSWORD"; // Password
String qmanager = "MB7QMGR"; // Queue Manager name
String q = "CLUSTERQ";
int options = MQC.MQOO_OUTPUT ;
try
{
MQQueueManager qMgr;
MQQueue requestQueue;
MQPutMessageOptions pmo = new MQPutMessageOptions();
Hashtable properties = new Hashtable();
// properties.put(MQC.USER_ID_PROPERTY, user);
// properties.put(MQC.PASSWORD_PROPERTY, password);
properties.put(MQC.HOST_NAME_PROPERTY, server);
properties.put(MQC.PORT_PROPERTY, port);
properties.put(MQC.CHANNEL_PROPERTY, "SYSTEM.DEF.SVRCONN");
// create the queue manager object
qMgr = new MQQueueManager(qmanager, properties);
// annd access the queue
requestQueue = qMgr.accessQueue(q, options);
// Set put options for message
// pmo.options = MQC.MQOO_BIND_NOT_FIXED;
// Make MQ generate new MessageID for each message
//pmo.options |= MQC.MQOO_BIND_NOT_FIXED;
// Now lets create the MQ Message
MQMessage requestMessage = new MQMessage();
// Populate the message with some text
requestMessage.writeUTF("Test message");
// and write to the queue
requestQueue.put(requestMessage, pmo);
byte[] msgID = requestMessage.messageId;
// Now close down
requestQueue.close();
qMgr.close();
}
catch (MQException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Apr 11, 2013 7:00 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
your understanding is wrong. You seem to be confusing both MQ Clustering and HA clustering.
Why would you expect to be able to put a message anywhere if the queue manager you are trying to connect to is not available?
This would be HA behavior.
MQ Clustering is only for load balancing... not for High Availability
Working as designed.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
RadhamaniRamadoss |
Posted: Thu Apr 11, 2013 9:23 pm Post subject: |
|
|
Apprentice
Joined: 08 Oct 2009 Posts: 42
|
Thank you ..... I got it now !!!! The difference is wonderfully explained...Thanks a lot ! |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|