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 » Java/JMS MQSeries Programming Question.....

Post new topic  Reply to topic Goto page 1, 2  Next
 Java/JMS MQSeries Programming Question..... « View previous topic :: View next topic » 
Author Message
csmith28
PostPosted: Fri Jan 07, 2005 8:17 am    Post subject: Java/JMS MQSeries Programming Question..... Reply with quote

Grand Master

Joined: 15 Jul 2003
Posts: 1196
Location: Arizona

Can Remote Client Applications using JMS and JAVA or just JAVA be coded to perform its own Load Balancing between two or more MQManagers?
_________________
Yes, I am an agent of Satan but my duties are largely ceremonial.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jan 07, 2005 8:24 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Yes it's all in the code and properties files
I would code to have properties files pass an order of preference
Then retrieve the corresponding qct/tcf from jndi (JMS)
or pass the parameters.

Now on connection fail close everything and try next in list.

Enjoy
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Fri Jan 07, 2005 8:53 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

That's not really load balancing, though. That's failover.

You'd want to code or modify a connection pool so that it would return a given connection based on the load.

A simple example would be something that maintained an array of connections, and an internal index to the array. Every time the getConnection method was called, it would return the connection at the current index, and update the index to the next. This would be a round robin type scheme.

Then your actual business objects would use the connection pool, and get a new connection for some logical unit of work (every message to be put, or every transaction to be handled, or etc).

So, yes, in Java or JMS you can create an object that maintains multiple client connections to different machines, and you can then manipulate that object to produce a load balancing scheme.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
csmith28
PostPosted: Fri Jan 07, 2005 9:08 am    Post subject: Reply with quote

Grand Master

Joined: 15 Jul 2003
Posts: 1196
Location: Arizona

I thought so. Just wanted to get a second, opinion before I opened my mouth.

Thanks guys.
_________________
Yes, I am an agent of Satan but my duties are largely ceremonial.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jan 07, 2005 1:34 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Jeff agreed with you.

However if you want real load balancing -- not at the logon level but at the workload level I guess you would have to use a gateway manager and a cluster.

Thanks
F.J.
Back to top
View user's profile Send private message Send e-mail
csmith28
PostPosted: Fri Jan 07, 2005 1:48 pm    Post subject: Reply with quote

Grand Master

Joined: 15 Jul 2003
Posts: 1196
Location: Arizona

Ok so....

Here is my situation.

I have a number Production Application Servers. Each Server hosts Applications that connect as Clients using both stand alone and clustered WebSphere and WebLogic applications Servers. Some use Java while others use JMS and Java to connect to a single MQManager on a Dedicated Server. For the sake of argument we will call this MQManager AIXQM01.

AIXQM01 sends these messages to two other remote MQManagers depending on the application. One is on a MainFrame "ZOSQM". The other is on an AS/400 AS4QM.

The problem is AIXQM01 is a singel point of failure.

One of the options that are being bantered about to eliminate AIXQM01 as a single point of failure is to build a second MQManager "AIXQM02" on a Second Dedicated Server and have the Application Developers modify their code and properties files so they can Load Balance as explained by Jeff. Dammit Jim, I'm and MQAdmin not an MQ Application Programmer.

Now, since the Destination Queues on ZOSQM and AS4QM will be the same regardless of which of the AIXQM's they come from it should not be neccessary to create a second group of Local Queue's for the backend applications to get the messages from.

But since a QRemote can only point to one MQManager we would have to create new QRemotes on ZOSQM and AS4QM to point back to the newly created AIXQM02 for the messages return trip.

So as long as the ReplyToQueue and ReplyToQManagers are defined in the Message Descriptor the messages should get back to where they need to be to complete the transaction. Assuming the applications on the MainFrame and AS/400 keep the information from the Message Descriptors.

Is this a fair assesment?

Is this a reasonable conclusion?

Is this a reasonable solution to my problem?

Is there a better way?
_________________
Yes, I am an agent of Satan but my duties are largely ceremonial.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Jan 07, 2005 1:55 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

What does AIXQM01 buy you, other than being a single point of failure?

Have the apps client connect directly to the MainFrame "ZOSQM" or the AS/400 AS4QM.

One way to load balance is they should specify a blank QM, port # xxxx, and channel name aaaa. Both the MainFrame "ZOSQM" or the AS/400 AS4QM listen on port xxxx and have a channel called aaaa. The hostname that the apps code for is zzzz. The only thing that listens for zzzz is an F5 switch. Let it load balance the incoming work to either the MainFrame "ZOSQM" or the AS/400 AS4QM.


Or skip the F5 and let the apps code the workload balancing. AMybe if the current time stamp ends in an even # go to the MF, otherwise go to the AS/400, but if either gives you a 2059, go to the other. This is the most bulletproof way I think.

Or make AIXQM01 Highly available by using Hardware clustering, and the clients only need to aim at the one QM again. That way it will always be up (well, 99.99% of the time anyway).
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 07, 2005 2:00 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

PeterPotkay wrote:
What does AIXQM01 buy you, other than being a single point of failure?


Probably security proxying and simplification.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jan 07, 2005 2:03 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Sure there is a better way

I understand that you use AIX as a router...

Forget about the additional remote queues.
Just create the default path/channel.
Have your messages specify the reply to queue/qmgr
code your app to return the info in the reply to queue/qmgr.
Doesn't matter from which AIX the message came as it's going to be put on the reply to queue/qmgr. (Hopefully from the same connection)

Now if you have send and forget messages from the MF / AS400, you could put the 2 AIX into a cluster and have them load balanced...?
Not a perfect fail over but better than nothing...

Enjoy
Back to top
View user's profile Send private message Send e-mail
csmith28
PostPosted: Fri Jan 07, 2005 2:17 pm    Post subject: Reply with quote

Grand Master

Joined: 15 Jul 2003
Posts: 1196
Location: Arizona

PeterPotkay wrote:
What does AIXQM01 buy you, other than being a single point of failure?

Have the apps client connect directly to the MainFrame "ZOSQM" or the AS/400 AS4QM.


This is a long story that started long before I was employed at my current position. It involves some un-wise decisions that were made by people much higher on the food chain than I, based on inaccurate information.

PeterPotkay wrote:
One way to load balance is they should specify a blank QM, port # xxxx, and channel name aaaa. Both the MainFrame "ZOSQM" or the AS/400 AS4QM listen on port xxxx and have a channel called aaaa. The hostname that the apps code for is zzzz. The only thing that listens for zzzz is an F5 switch. Let it load balance the incoming work to either the MainFrame "ZOSQM" or the AS/400 AS4QM.


Persistent messages eliminate the use of and F5 to Load Balance due to the F5's inability to deal with Sequence number values. Our applications demand the use of persistent messaging. For example ZOSQM sends message 01 thru 50 to the F5 and the F5 sends those messages to AIXQM01. Works fine but then when ZOSQM sends message 51-100 to the F5 it trys to put the messages on AIXQM02 but the receiver channel on AIXQM02 is expecting message 01 not 51. The receiver channel goes indoubt and fails.

PeterPotkay wrote:

Or skip the F5 and let the apps code the workload balancing. AMybe if the current time stamp ends in an even # go to the MF, otherwise go to the AS/400, but if either gives you a 2059, go to the other. This is the most bulletproof way I think.

Or make AIXQM01 Highly available by using Hardware clustering, and the clients only need to aim at the one QM again. That way it will always be up (well, 99.99% of the time anyway).


I have also offered HACMP as an alternative. I have been asked to provide other options.
_________________
Yes, I am an agent of Satan but my duties are largely ceremonial.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Jan 07, 2005 2:22 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

csmith28 wrote:

PeterPotkay wrote:
One way to load balance is they should specify a blank QM, port # xxxx, and channel name aaaa. Both the MainFrame "ZOSQM" or the AS/400 AS4QM listen on port xxxx and have a channel called aaaa. The hostname that the apps code for is zzzz. The only thing that listens for zzzz is an F5 switch. Let it load balance the incoming work to either the MainFrame "ZOSQM" or the AS/400 AS4QM.


Persistent messages eliminate the use of and F5 to Load Balance due to the F5's inability to deal with Sequence number values. Our applications demand the use of persistent messaging. For example ZOSQM sends message 01 thru 50 to the F5 and the F5 sends those messages to AIXQM01. Works fine but then when ZOSQM sends message 51-100 to the F5 it trys to put the messages on AIXQM02 but the receiver channel on AIXQM02 is expecting message 01 not 51. The receiver channel goes indoubt and fails.


Persistent or not makes no diff for sequence numbers over channels. They each get a sequence number.

EXCEPT for client channels. There are no sequence numbers for messages going over client channels, so an F5 load balancer is viable for MQClients to pass thru.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
csmith28
PostPosted: Fri Jan 07, 2005 2:29 pm    Post subject: Reply with quote

Grand Master

Joined: 15 Jul 2003
Posts: 1196
Location: Arizona

fjb_saper wrote:
Sure there is a better way

I understand that you use AIX as a router...

Forget about the additional remote queues.
Just create the default path/channel.
Have your messages specify the reply to queue/qmgr
code your app to return the info in the reply to queue/qmgr.
Doesn't matter from which AIX the message came as it's going to be put on the reply to queue/qmgr. (Hopefully from the same connection)

Now if you have send and forget messages from the MF / AS400, you could put the 2 AIX into a cluster and have them load balanced...?
Not a perfect fail over but better than nothing...

Enjoy



If IBM Best Practice Naming Conventions were used I guess this would work but alas they have not. The Applications on the MainFrame and AS/400 have historically been coded to put their messages to a QAlias named XX.APP.BLAH.REPLY.QA01 that points to a QRemote named XX.QMGR.APP.BLAH.REPLY.QR01 that points to an XMITQ name something like XX.LOCALQM.TO.RQMNAME.QX01.

As far as I understand a QA can only have one TARGQ and a QRemote can only have one XMITQ.

So it would fail right? Am I missing something here?
_________________
Yes, I am an agent of Satan but my duties are largely ceremonial.
Back to top
View user's profile Send private message
csmith28
PostPosted: Fri Jan 07, 2005 2:36 pm    Post subject: Reply with quote

Grand Master

Joined: 15 Jul 2003
Posts: 1196
Location: Arizona

PeterPotkay wrote:
csmith28 wrote:

PeterPotkay wrote:
One way to load balance is they should specify a blank QM, port # xxxx, and channel name aaaa. Both the MainFrame "ZOSQM" or the AS/400 AS4QM listen on port xxxx and have a channel called aaaa. The hostname that the apps code for is zzzz. The only thing that listens for zzzz is an F5 switch. Let it load balance the incoming work to either the MainFrame "ZOSQM" or the AS/400 AS4QM.


Persistent messages eliminate the use of and F5 to Load Balance due to the F5's inability to deal with Sequence number values. Our applications demand the use of persistent messaging. For example ZOSQM sends message 01 thru 50 to the F5 and the F5 sends those messages to AIXQM01. Works fine but then when ZOSQM sends message 51-100 to the F5 it trys to put the messages on AIXQM02 but the receiver channel on AIXQM02 is expecting message 01 not 51. The receiver channel goes indoubt and fails.


Persistent or not makes no diff for sequence numbers over channels. They each get a sequence number.

EXCEPT for client channels. There are no sequence numbers for messages going over client channels, so an F5 load balancer is viable for MQClients to pass thru.


Sorry I got the impression that you wanted to put the F5 between the MainFrame, AS/400 QManagers and AIXQM01 and AIXQM02.

Are you saying the F5 should be place between the Application Servers and the AIXQM0*?
_________________
Yes, I am an agent of Satan but my duties are largely ceremonial.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Jan 07, 2005 2:46 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Yah. If the App server need to client connect, put the F% between them and the AS/400 / Mainframe, and let the F5 load balance them between the 2. AIXQM01 goes away - no longer needed.

Or skip the F5 and let the apps code load balnce between thwe AS/400 and the Mainframe. Again, AIXQM01 goes away - no longer needed.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
csmith28
PostPosted: Fri Jan 07, 2005 3:05 pm    Post subject: Reply with quote

Grand Master

Joined: 15 Jul 2003
Posts: 1196
Location: Arizona

jefflowrey wrote:
PeterPotkay wrote:
What does AIXQM01 buy you, other than being a single point of failure?


Probably security proxying and simplification.


Yes, that and to a certain extent guarunteed delivery. If the MainFrame or AS/400 MQManagers are not available the messages will be stored on AIXQM01 until service is restored.

Also, some of the Applications use AIXQM01 to pass messages back and forth from each other. As in App A sends a message to the MainFrame. MainFrame sends the response to Application A's REPLY Queue on AIXQM01. Application A picks up the message and puts it back on AIXQM01 APP_B QLocal.

Oooh no, gotta go. Prod outage.
_________________
Yes, I am an agent of Satan but my duties are largely ceremonial.
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 » Java/JMS MQSeries Programming Question.....
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.