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 » Round Robin for a point to point messaging model?

Post new topic  Reply to topic Goto page 1, 2  Next
 Round Robin for a point to point messaging model? « View previous topic :: View next topic » 
Author Message
fcx84
PostPosted: Tue Feb 09, 2010 5:08 pm    Post subject: Round Robin for a point to point messaging model? Reply with quote

Novice

Joined: 09 Feb 2010
Posts: 12

Dear experts,

I am a new to WMQ. I am now working on a project which uses a single queue manager (QM).

I have a few queries to ask regarding my project:

1.May I know if WMQ allows application to send to a queue with least messages?
2. Do WMQ allows messages from a queue to pass to other queues if the application is hang or crash? Is there a forwarding mechansim like in weblogic that do allows messages in a queue to be forwarded to other queues which have application attached to it.
3. Can WMQ detect an application connected to the QM is hang?
4. Does WMQ process the queues with application connected to it in a round robin fashion?

Hope some WMQ gurus can help me out and show me the light
Back to top
View user's profile Send private message
mvic
PostPosted: Tue Feb 09, 2010 5:40 pm    Post subject: Re: Round Robin for a point to point messaging model? Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

fcx84 wrote:
1.May I know if WMQ allows application to send to a queue with least messages?

There is no way to achieve this "out of the box". It might be possible to do it using complicated API exits that you would have to write. But do you really want to choose a destination queue based on how deep it is? Please tell us why. The conversation might be interesting and I think after that conversation you might decide not to pursue this design idea.
Quote:
2. Do WMQ allows messages from a queue to pass to other queues if the application is hang or crash? Is there a forwarding mechansim like in weblogic that do allows messages in a queue to be forwarded to other queues which have application attached to it.

Not out of the box, no. But wouldn't it be the best idea just to restart the failed application?
Quote:
3. Can WMQ detect an application connected to the QM is hang?

No, this is not possible. In fact it is hard to imagine any way in which a hang can be determined except with human inspection. Please tell us why an application hang needs to be detected by MQ in your design.
Quote:
4. Does WMQ process the queues with application connected to it in a round robin fashion?

Did you mean applications, plural? Then the answer is no, if multiple applications are getting from a single queue, they are served in no defined order. Do you need it to be defined - again please say the reason.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Feb 09, 2010 6:30 pm    Post subject: Re: Round Robin for a point to point messaging model? Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

fcx84 wrote:
1.May I know if WMQ allows application to send to a queue with least messages?


No. One of the principles is that the sending application should be unaware of what application is processing it's messages or where it's hosted. The term you'll see in the documentation is "decoupled". It would be tricky to do what you're suggesting and the disadvantages would likely outweight any advantages.

fcx84 wrote:
2. Do WMQ allows messages from a queue to pass to other queues if the application is hang or crash? Is there a forwarding mechansim like in weblogic that do allows messages in a queue to be forwarded to other queues which have application attached to it.


No.

fcx84 wrote:
3. Can WMQ detect an application connected to the QM is hang?


No.

fcx84 wrote:
4. Does WMQ process the queues with application connected to it in a round robin fashion?


Do you mean if multiple applications are connected to a single queue are the messages delivered in a round robin fashion? If so, again no - the message is delivered to the application which has had a get request waiting longest. If you have multiple copies of a queue in a WMQ cluster with an application attached to each then messages are distributed in a round robin fashion unless you configure the cluster to deliver them in a different way.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fcx84
PostPosted: Tue Feb 09, 2010 6:43 pm    Post subject: Reply with quote

Novice

Joined: 09 Feb 2010
Posts: 12

Hi Vic,

Thanks for the quick responses.

My application requires me to design to handle 2 types of messages.
Only a single QM will be used.

Message A is data need to send to a least busy application
Message B send to all applications (use Message Broker pub/sub messaging problem to address)

The design perspective is as follows:
Application A sends to QM with either message A or B to Application A1,B1 or C1 etc.
QM has a few connected at the other end, Applications A1,B1,C1 etc.
If message A is receive by the QM, QM will need to route to the least busy engine.


If QM is not able to cater for the above scenario is there any work around to handle this kind of situation?

For the 2nd point. Yes restarting the application is a definite. However, there are also other application which are available to handle the messages thus is there any way to forward those messages in the dead application queue to other queues?

For point 3, I did read up on some of the API and found out that there is a method to detect the heartbeat of the channel, so I am planning to use the channel heartbeat to detect if the application is hang or crash. As I can set a threshold of like if the queue is not moving in 5 minutes, assume the application is dead, kill the application


For point 4. SOrry there was a typo. The multiple applications are not getting information from a single queue. There will be multiple queues defined in the QM. If the application order is to be defined how do I do it?

Additional doubts i have is when an application sends a msg to QM, it do not need to specify the actual queue name, it can simply provide a dynamic queue name and QM will be able to assign any queue to process the request?

For a setup of the client channels between application and QM. WQM does provides a channel auto-definition feature. Thus, channels can be automatically setup by QM right ?

Kindly advise me on the above issue. Hope its more clear.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Feb 09, 2010 7:03 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

fcx84 wrote:
Hi Vic,


There's no c in my name.

fcx84 wrote:
If message A is receive by the QM, QM will need to route to the least busy engine.


So you've got 3 application receiving a lot of message B via pub/sub and needs to deal with the occassional message A? And any of the applications can deal with a message A, and there's no connection between message A & B?

In that case why not just set the priority of message A higher so it jumps the queue of whatever instance you decide to send it to?


fcx84 wrote:
If QM is not able to cater for the above scenario is there any work around to handle this kind of situation?


Only what I've outlined above, and I'm rather suspicious of a design that requires anything different. What you've described sounds rather like a tightly coupled design than a messaging one.

fcx84 wrote:
For the 2nd point. Yes restarting the application is a definite.


Why? If you have an application that uses a database do you expect the database software to detect the application crashing and restart it?

fcx84 wrote:
However, there are also other application which are available to handle the messages thus is there any way to forward those messages in the dead application queue to other queues?


No. The queue manager would be unable to detect the application's failure.

fcx84 wrote:
For point 3, I did read up on some of the API and found out that there is a method to detect the heartbeat of the channel, so I am planning to use the channel heartbeat to detect if the application is hang or crash. As I can set a threshold of like if the queue is not moving in 5 minutes, assume the application is dead, kill the application


If the application is dead, what's issuing the API call? The queue manager won't. If you're talking about writing an external application to monitor the WMQ application to see if it's still reading the queue:

a) There are commerical applications that monitor & restart such things
b) There are better ways to detect a failed application (such as dequeue rate)

fcx84 wrote:
For point 4. SOrry there was a typo. The multiple applications are not getting information from a single queue. There will be multiple queues defined in the QM. If the application order is to be defined how do I do it?


You'll need to write specific code in WMB to do this. WMQ will send to a specified destination or namelist. I imagine this is something to do with this least busy thing.

fcx84 wrote:
Additional doubts i have is when an application sends a msg to QM, it do not need to specify the actual queue name, it can simply provide a dynamic queue name and QM will be able to assign any queue to process the request?


If the application doesn't specify a destination, how is the queue manager supposed to know which queue has an application available to process the message? Even if it could detect which of the defined queues is being read by an application (which wouldn't work if the queue was triggered) how does it know the application is appropriate to the message?

fcx84 wrote:
For a setup of the client channels between application and QM. WQM does provides a channel auto-definition feature. Thus, channels can be automatically setup by QM right ?


Yes but it's very seldom used; it's a serious secuity risk without a security exit in place & most auditors don't like it.

I think you should go back and re-read the Intercommunication manual. This design sounds a lot like it's going head to head with the software rather than exploiting the features.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Feb 09, 2010 7:07 pm    Post subject: Re: Round Robin for a point to point messaging model? Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fcx84 wrote:
3. Can WMQ detect an application connected to the QM is hang?


This is a restatement of the Halting Problem.

I doubt WebLogic has solved it, either.
Back to top
View user's profile Send private message
fcx84
PostPosted: Tue Feb 09, 2010 9:37 pm    Post subject: Reply with quote

Novice

Joined: 09 Feb 2010
Posts: 12

Hi Jeff,

Yes. WebLogic do not detect if an application is hang.

May I seek your wise wisdom, that what is the best solution or best practices to work around this problem?

Thank you.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Feb 09, 2010 9:47 pm    Post subject: Reply with quote

Grand High Poobah

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

fcx84 wrote:
Hi Jeff,

Yes. WebLogic do not detect if an application is hang.

May I seek your wise wisdom, that what is the best solution or best practices to work around this problem?

Thank you.


Best practice tells you monitoring is the solution.
If your dequeue rate is less than your enqueue rate you have a growing queue and possibly a problem. Nearly all monitoring products can alert you on the right situation / trigger. It is up to you to define the right parameters and values. You could go as far as to alert if the dequeue rate is less than x times the number of ipprocs... It is then up to you to find the hung instance of the app and to bounce it...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
fcx84
PostPosted: Tue Feb 09, 2010 10:06 pm    Post subject: Reply with quote

Novice

Joined: 09 Feb 2010
Posts: 12

Hi Vi,

Once again thanks for your advises and enlightenments

Quote:
So you've got 3 application receiving a lot of message B via pub/sub and needs to deal with the occassional message A? And any of the applications can deal with a message A, and there's no connection between message A & B?


Yes, you are spot on.

Quote:
In that case why not just set the priority of message A higher so it jumps the queue of whatever instance you decide to send it to?


Yes alternatively I can set the priority of the message. However, the message A must always be send to the queue with least message. So that the least busy application can process the message A.


Quote:
If you're talking about writing an external application to monitor the WMQ application to see if it's still reading the queue:

a) There are commerical applications that monitor & restart such things
b) There are better ways to detect a failed application (such as dequeue rate)


May I know what are the commerical applications?
May I know if there are any sites for me to read up on dequeue rate?

Quote:
No. The queue manager would be unable to detect the application's failure.


So WMQ cannot allow forwarding messages from a non-processing queue to any other queues in the QM. Thus, for my this project I would need to improvise using weblogic as it provides a mechanism called distributed queue.

Quote:
You'll need to write specific code in WMB to do this. WMQ will send to a specified destination or namelist. I imagine this is something to do with this least busy thing.


Thus, for the matter I must adopt the point to point messaging model to handle my message A. As the QM actually do have a distribution list to send a message to multiple destinations. So actually from this distribution list can I specify that in this list the least busy application to handle the message A?


Quote:
If the application doesn't specify a destination, how is the queue manager supposed to know which queue has an application available to process the message? Even if it could detect which of the defined queues is being read by an application (which wouldn't work if the queue was triggered) how does it know the application is appropriate to the message?


Maybe for this point my question is not so clear. What I mean is the application can just sent to a destination, lets call it queue A (alias queue). QM is able to assign any local queue to that queue A called by the application?


By the way just would like to know is that a limit to how many queues to setup in websphere mQ? From my knowledge is there will no limitation to the number of queues defined is limited only by the resources of the system where the QM is installed.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Feb 09, 2010 10:19 pm    Post subject: Reply with quote

Grand High Poobah

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

Quote:
Yes alternatively I can set the priority of the message. However, the message A must always be send to the queue with least message. So that the least busy application can process the message A.


Again this is not a WMQ concept. WMQ does not deal with applications. It deals with transport.
Can you please define "least busy application" ?
Isn't that a matter of opinion and resources and scalability?
Have you looked into MQ clusters and load balancing?

As for WMQ you should look at message priority. With a high priority and message distribution sequence set to priority you will process high priority messages first. The caveats there are that you might not be scaled high enough to ever get to the low priority messages, or that it makes not difference with FIFO because there are no messages waiting to be consumed in the queue....

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
fcx84
PostPosted: Tue Feb 09, 2010 10:58 pm    Post subject: Reply with quote

Novice

Joined: 09 Feb 2010
Posts: 12

Hi fjb_saper,

The least busy application = to the application whose queue has the least message

Therefore how can the queue manager actually know which queue has the least massage if I have 3 applications attached to it? Can actually queue manager do that without any monitoring, i believe it can't.

Actually even if the priority of the message is set, it will not be send to the least busy queue. Thus, problem unresolved.

To eventually solve this problem I can think of is maybe queue manager do provide a round robin mechanism to pass the message A to appA1, appB1,appC1 etc queue in a round robin fashion. As weblogic do provide such mechanism. However, I jus wonder if websphere MQ is able to cater for this issue.

As I do believe websphere MQ should be more powerful as compared to weblogic. Correct me if I m wrong.
Back to top
View user's profile Send private message
mvic
PostPosted: Wed Feb 10, 2010 1:07 am    Post subject: Re: Round Robin for a point to point messaging model? Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

Vitor wrote:
fcx84 wrote:
4. Does WMQ process the queues with application connected to it in a round robin fashion?


Do you mean if multiple applications are connected to a single queue are the messages delivered in a round robin fashion? If so, again no - the message is delivered to the application which has had a get request waiting longest.

This is not correct, I'm afraid. If this were true you could indeed describe the delivery pattern as "round robin". In fact it is undefined which app will be given the message. It is theoretically possible to promise which one will get the message, but as far as I know, MQ does not promise. Anyway if you have multiple getters on a queue with the same match criteria they SHOULD all be identical so it should not be detectable which one got a message and which one did not.


Last edited by mvic on Wed Feb 10, 2010 1:58 am; edited 1 time in total
Back to top
View user's profile Send private message
mvic
PostPosted: Wed Feb 10, 2010 1:45 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

fcx84 wrote:
Hi Vic,

Vitor and I are going to get a bit confused.. please get the spelling right, then it will be a little clearer. NB. you can edit your old posts if you need to.

Quote:
For point 4. SOrry there was a typo. The multiple applications are not getting information from a single queue. There will be multiple queues defined in the QM. If the application order is to be defined how do I do it?

Other things you have said do seem to imply:
- you have a least busy and a most busy application.
- you want MQ to choose between these purely on the basis of "busy"ness.

I therefore thought these must be copies of each other.

Please give some more detail on what your getter applications are.

No need for sensitive details. But if you can go a little further than A1, B1, C1 etc. this will shed a bit of light on the discussion.

(EDIT: Removed some of what I had said about copies.. until more is said about the getters by the OP.)
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Feb 10, 2010 6:06 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

fcx84 wrote:
However, the message A must always be send to the queue with least message. So that the least busy application can process the message A.


Why? I don't understand the requirement. The only reason I can think of to send a message to the "least busy" application is so that it doesn't wait long to be processed. A higher priority fixes that. So why do you need this? Is it some management requirement with no technical merit, or are you simply trying to port a concept from an app server with multiple threads under it without really thinking it through?

fcx84 wrote:
May I know what are the commerical applications?
May I know if there are any sites for me to read up on dequeue rate?


There's an entire section on monitoring products in this forum. There's also an entire manual on monitoring WMQ in the product documentation which discusses (among other things) enqueue & dequeue rates.

fcx84 wrote:
can I specify that in this list the least busy application to handle the message A?


No, because for the upteenth time the queue manager has no knowledge of the application connected to the queue or how it's performing. So it will put the message where you tell it.

fcx84 wrote:
What I mean is the application can just sent to a destination, lets call it queue A (alias queue). QM is able to assign any local queue to that queue A called by the application?


No because an alias queue points to a fixed destination. Read the manual again.

fcx84 wrote:
By the way just would like to know is that a limit to how many queues to setup in websphere mQ? From my knowledge is there will no limitation to the number of queues defined is limited only by the resources of the system where the QM is installed.


That's correct.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Feb 10, 2010 6:07 am    Post subject: Re: Round Robin for a point to point messaging model? Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mvic wrote:
This is not correct, I'm afraid. If this were true you could indeed describe the delivery pattern as "round robin". In fact it is undefined which app will be given the message. It is theoretically possible to promise which one will get the message, but as far as I know, MQ does not promise. Anyway if you have multiple getters on a queue with the same match criteria they SHOULD all be identical so it should not be detectable which one got a message and which one did not.


Well I've learned something!

It's a good day.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » Round Robin for a point to point messaging model?
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.