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 Installation/Configuration Support » MQ Intercommunication

Post new topic  Reply to topic
 MQ Intercommunication « View previous topic :: View next topic » 
Author Message
qwerty123
PostPosted: Tue May 16, 2006 2:48 pm    Post subject: MQ Intercommunication Reply with quote

Novice

Joined: 09 Oct 2003
Posts: 23

Hi All,

I am fairly new to MQ and for an upcoming project, we are trying to achieve application integration using multiple queue managers. We intend to have the setup in the following way -

The front end logic is running on multiple application servers (non clustered) with each app server having it's own queue manager.

Then we have a middle layer of MQ managers running in cluster (CLUST1) and finally we have the tier running the business logic (2 instances) with one QM for each instance and both QMs in a cluster (CLUST2).

I am trying to understand how messages can be sent and received between the front-end and the business-logic tiers with the middle-tier MQ cluster in the architecture.

I have some understanding on how this can be done - will need to define a remote queue on the front end servers resolving to the business logic tier for user requests and a local queue on the front-end server for the response from the business logic tier and vice versa for the business logic tier.

I guess I am mostly trying to understand the setup of remote queues with multiple queue manangers in picture i.e. can you define a remote queue that resolves to a remote queue on another QM which in turn resolves to a local queue on another remote server.

Would appreciate if someone could explain how this can be achieved and the pros/cons in this architecture.

Thanks in advance
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Tue May 16, 2006 4:48 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Do the messages have to pass thru CLUST1 when going from the front end non clustered QMs to CLUST2? If yes, why?
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
qwerty123
PostPosted: Wed May 17, 2006 12:34 pm    Post subject: Reply with quote

Novice

Joined: 09 Oct 2003
Posts: 23

Appreciate your response -

Yes, we would ideally like the messages to go through the CLUST1 because we want a central set of QMs that act as a message routing area for various applications. Even if my argument for using the CLUST1 is not strong enough, I am wondering if this is feasible and is so, how ?

Secondly, if we take out the CLUST1 and just have the FE queue managers talk to the queues on CLUST2 (using MQ intecommunications), what kind of queue/channel definitions we will have to do on both ends (remember we have the same queue names on the QMs in the cluster for high availability and load balancing)? Finally, could you please provide us (or direct us) to a piece of Java code which shows how the message can be sent/put from the FE to the BE in this kind of setup (I mean sending a message to a cluster queue)

thanks once again
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed May 17, 2006 4:02 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

qwerty123 wrote:
Yes, we would ideally like the messages to go through the CLUST1 because we want a central set of QMs that act as a message routing area for various applications. Even if my argument for using the CLUST1 is not strong enough, I am wondering if this is feasible and is so, how ?

FE QMs have remote queues pointing at the local queues in CLUST2. The FE remote queues have a remote QM name of CLUST2. They have remote q name as the actual q name in CLUST2. They also have a XMITQ name of the XMITQ from each FE QM to one QM in CLUST1 that has regular sender / receiver channels to all the FE QMs. This QM in CLUST1 is known as a gateway QM (lets call it GatewayQM1). This will get the messages into CLUST1.

Somehow you have established connectivity between CLUST1 and CLUST2. Most likely via 2nd QM that acts as gateway between CLUST1 and CLUST2. On GatewayQM2, you need to create a QMAlias called CLUST2, and cluster it to both CLUST1 and CLUST2 by clustering it via a namelist. That QMAlias CLUST2 on GatewayQM2 will have a blank value for Remote QM name and XMITQ. What it does is say to any QM in CLUST1 that it wants any messages where the Remote QM name is CLUST2. Once these CLUST2 destined messages arrive on GatewayQM2, that QMAlias wipes out the remote QM name to blank, and the messages are free to load balnce inside CLUST2.


qwerty123 wrote:
Secondly, if we take out the CLUST1 and just have the FE queue managers talk to the queues on CLUST2 (using MQ intecommunications), what kind of queue/channel definitions we will have to do on both ends (remember we have the same queue names on the QMs in the cluster for high availability and load balancing)? Finally, could you please provide us (or direct us) to a piece of Java code which shows how the message can be sent/put from the FE to the BE in this kind of setup (I mean sending a message to a cluster queue)

Same deal basically. FE QMs have remote queues pointing at the local queues in CLUST2. The FE remote queues have a remote QM name of CLUST2. They have remote q name as the actual q name in CLUST2. They also have a XMITQ name of the XMITQ from each FE QM to one QM in CLUST2 that has regular sender / receiver channels to all the FE QMs. This QM in CLUST2 is known as a gateway QM (lets call it GatewayQM2). This will get the messages into CLUST2. On GatewayQM2, create a QMAlias called CLUST2, with a blank Remote Q name, a blank Remote QM name. and a blank XMITQ. Once these CLUST2 destined messages arrive on GatewayQM2, that QMAlias wipes out the remote QM name to blank, and the messages are free to load balnce inside CLUST.

In either scenario, create QM Aliases on the gateway QMs for all the FE QMs, so that anytime an app puts a message looking for one of the FE QMs, the QM alias will "catch" it and put it down the correct XMITQ to the proper FE QM.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
qwerty123
PostPosted: Thu May 18, 2006 9:57 am    Post subject: Reply with quote

Novice

Joined: 09 Oct 2003
Posts: 23

Thanks very much for your help Peter.

I have setup the way you explained and got good results, however I am having problems sending the message back to the FE servers.

Peter wrote -
<<<<< In either scenario, create QM Aliases on the gateway QMs for all the FE QMs, so that anytime an app puts a message looking for one of the FE QMs, the QM alias will "catch" it and put it down the correct XMITQ to the proper FE QM.
>>>

I created an alias on the gateway for the FE QM and did the other setup, but I don't know how to send the message back to the FE, I mean what will be my connection parameters on MQOpen. I have the following setup -


In CLUSTER1 (BE) -
CLUSQM1
CLUSQM2

CLUSQM3 - Gateway QM
This has the alias -
DEFINE QREMOTE(FRONTQM) RNAME(’ ’) RQMNAME(FEQM1) CLUSTER(CLUSTER)
It also has the necessary transmission queue and the sender channel definitions to the FE QMs.


On the FE -
FEQM1
Local Queue - FEQUEUE1

Now when I run the program from CLSUQM2, what should be my parameters for the MQOpen. Attached is the test Java program that I am using for writing messages to queues to validate this setup; as you can see this program takes the QM Name, host, port, channel name & the queue name as input parameters to open a queue and put a message, what should be my I/P parameters in this case ?

Thanks Once again in advance


package com.hsbc.ca.mq;

//==================================================================
//
// Program Name
// MQWrite
//
// Last date of modification
// 1 Oct 2000
//
// Description
// This java class will read a line of input from the keyboard
// and send it as a message. The program will loop until the
// user presses CTL^Z.
//
// Sample Command Line Parameters
// -h 127.0.0.1 -p 1414 -c CLIENT.CHANNEL -m MQA1 -q TEST.QUEUE
//
// Copyright(C), Roger Lacroix, Capitalware
//
// ------------------------------------------------------------------

import com.ibm.mq.*;
import java.util.Hashtable;

public class MQWrite {
private MQQueueManager _queueManager = null;
private Hashtable params = null;
public int port = 1414;
public String hostname = "127.0.0.1";
public String channel = "CLIENT.TO.MQA1";
public String qManager = "MQA1";
public String outputQName = "SYSTEM.DEFAULT.LOCAL.QUEUE";


public MQWrite()
{
super();
}
private boolean allParamsPresent()
{
boolean b = params.containsKey("-h") &&
params.containsKey("-p") &&
params.containsKey("-c") &&
params.containsKey("-m") &&
params.containsKey("-q");
if (b)
{
try
{
port = Integer.parseInt((String) params.get("-p"));
}
catch (NumberFormatException e)
{
b = false;
}
// Set up MQ environment
hostname = (String) params.get("-h");
channel = (String) params.get("-c");
qManager = (String) params.get("-m");
outputQName = (String) params.get("-q");

}
return b;
}
private void init(String[] args) throws IllegalArgumentException
{
params = new Hashtable(5);
if (args.length > 0 && (args.length % 2) == 0)
{
for (int i = 0; i < args.length; i+=2)
{
params.put(args[i], args[i+1]);
}
}
else
{
throw new IllegalArgumentException();
}

if (allParamsPresent())
{
// Set up MQ environment
MQEnvironment.hostname = hostname;
MQEnvironment.channel = channel;
MQEnvironment.port = port;

}
else
{
throw new IllegalArgumentException();
}
}
public static void main(String[] args)
{

MQWrite write = new MQWrite();

try
{
write.init(args);
write.selectQMgr();
write.write();
}
catch (IllegalArgumentException e)
{
System.out.println("Usage: java MQWrite <-h host> <-p port> <-c channel> <-m QueueManagerName> <-q QueueName>");
System.exit(1);
}
catch (MQException e)
{
System.out.println(e);
System.exit(1);
}
}
private void selectQMgr() throws MQException
{
_queueManager = new MQQueueManager(qManager);
}
private void write() throws MQException
{
String line = "Hello World";

int openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;

try
{
MQQueue queue = _queueManager.accessQueue( outputQName,
openOptions,
null, // default q manager
null, // no dynamic q name
null ); // no alternate user id


System.out.println("MQWrite v1.0 connected");


// Define a simple MQ message, and write some text in UTF format..
MQMessage sendmsg = new MQMessage();
sendmsg.format = MQC.MQFMT_STRING;
sendmsg.feedback = MQC.MQFB_NONE;
sendmsg.messageType = MQC.MQMT_DATAGRAM;
sendmsg.replyToQueueName = "T.CAHSBC.HFE.IPSHOST1.ERROR";
sendmsg.replyToQueueManagerName = qManager;

MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults, same
// as MQPMO_DEFAULT constant

sendmsg.clearMessage();
sendmsg.messageId = MQC.MQMI_NONE;
sendmsg.correlationId = MQC.MQCI_NONE;
sendmsg.writeString(line);

// put the message on the queue

queue.put(sendmsg, pmo);

System.out.println("message sent\n\n");

queue.close();
_queueManager.disconnect();

}
catch (com.ibm.mq.MQException mqex)
{
System.out.println(mqex);
}
catch (java.io.IOException ioex)
{
System.out.println("An MQ IO error occurred : " + ioex);
}

}
}
Back to top
View user's profile Send private message
qwerty123
PostPosted: Thu May 18, 2006 10:26 am    Post subject: Reply with quote

Novice

Joined: 09 Oct 2003
Posts: 23

Peter -

One more question, you said -

<<<<<<
FE QMs have remote queues pointing at the local queues in CLUST2. The FE remote queues have a remote QM name of CLUST2. They have remote q name as the actual q name in CLUST2. They also have a XMITQ name of the XMITQ from each FE QM to one QM in CLUST1 that has regular sender / receiver channels to all the FE QMs. This QM in CLUST1 is known as a gateway QM (lets call it GatewayQM1). This will get the messages into CLUST1.

Somehow you have established connectivity between CLUST1 and CLUST2. Most likely via 2nd QM that acts as gateway between CLUST1 and CLUST2.
>>>>>>>

Again I am trying to understand what kind of setup will exist on CLUST1 to connect to CLUST2 to establish the connectivity between the two. I mean I setup a remote definition for a queue on the FE QMs for a local queue on the QMs in CLUST2 and define channels on FE QMs for CLUST1 QMs which gets the message to CLUST1 but how does the message get transferred to the final localtion CLUST2?

I think this question is pretty much the same as the one I posted earlier today, my problem is I don't know what the connection parameters on the sending QM should be so as to get the message to the final QM in CLUST2 and what setup automatically transfers the messages through CLUST1.

Thanks in advance
Back to top
View user's profile Send private message
vennela
PostPosted: Thu May 18, 2006 10:27 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Look at overlapping clusters setup in the infocenter
Back to top
View user's profile Send private message Send e-mail Visit poster's website
PeterPotkay
PostPosted: Thu May 18, 2006 5:02 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

qwerty123 wrote:
Now when I run the program from CLSUQM2, what should be my parameters for the MQOpen. Attached is the test Java program that I am using for writing messages to queues to validate this setup; as you can see this program takes the QM Name, host, port, channel name & the queue name as input parameters to open a queue and put a message, what should be my I/P parameters in this case ?


When you are putting a message to a QM in CLUST2, regardless of where the message eventually goes, you specify the channel, host and port# for the QM in CLUST2, because that's what you are connecting to. When you issue the MQOPEN for putting the message, you specify the Remote Q name as the name of the q on the FE QM, and for the destination QM, you specify the name of the FE QM.

The QM you are connected to will see that you are specifying a destination QM other than itself, and will thus use MQ name resolution to find that destination QM. If you have things set up properly, it will find that destination QM by seeing a QM ALias by that name on the gateway QM, so it sends the mesage to the GW. The GW then sends the message to the FE QM because the QMAlias specifies the XMITQ to the FE QM.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
qwerty123
PostPosted: Fri May 19, 2006 9:28 am    Post subject: Reply with quote

Novice

Joined: 09 Oct 2003
Posts: 23

Hi Peter & Vennela,

Thanks very much for your help. I have been able to send messages from the BE QMs to the FE QMs, took me while to understand the setup

Much appreciated

Nav
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » MQ Intercommunication
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.