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 API Support » Use .NET to send message to MQ Cluster

Post new topic  Reply to topic
 Use .NET to send message to MQ Cluster « View previous topic :: View next topic » 
Author Message
Varun
PostPosted: Mon May 05, 2008 7:20 pm    Post subject: Use .NET to send message to MQ Cluster Reply with quote

Newbie

Joined: 01 May 2008
Posts: 2

Apologies if this has been asked before. I am a MQSeries newbie. I have been entrusted the task of evaluating MQSeries /Web MQ vis as vis MSMQ. I have setup the following -

2 virtual machines with windows 2003 + Websphere MQ 6.0 trial version. I have also configured the Web MQ servers as a cluster. Both the machines act as full repositories.

I have been able to send a message using .NET/C# code to a non clustered queue on a single machine. Can anyone please point me to some sample code which I can use connect/send message to a shared/clustered queue. I am hoping that a shared clustered queue across machines acts as a single queue. If a particular machine would fail, the active machine would carry on processing. Moreover, it would pick up the messages which had been sent to the failed machine.

Any sample code/comments/validation of my assumptions would be helpful.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon May 05, 2008 8:14 pm    Post subject: Re: Use .NET to send message to MQ Cluster Reply with quote

Grand High Poobah

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

Varun wrote:

I have been able to send a message using .NET/C# code to a non clustered queue on a single machine. Can anyone please point me to some sample code which I can use connect/send message to a shared/clustered queue. I am hoping that a shared clustered queue across machines acts as a single queue. If a particular machine would fail, the active machine would carry on processing. Moreover, it would pick up the messages which had been sent to the failed machine.

Any sample code/comments/validation of my assumptions would be helpful.


This is not the way MQ behaves. You seem to be mixing several concepts.
WAS clusters with JMS Engine can behave the way you want on the SI Bus.

You need to remember that MQ Clustering is there for load balancing. If you need High Availability (HA) you need some kind of hardware clustering... (HACMP and other options depending on OS...)

And by the way here is the golden rule in MQ:
You can only get a message from a queue that is local (as in ql) to a qmgr you are connected to...

There is a good library of materials on line and even a cluster manual

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Varun
PostPosted: Mon May 05, 2008 8:49 pm    Post subject: Thanks. Have some more questions Reply with quote

Newbie

Joined: 01 May 2008
Posts: 2

As far as I understand the following -

Web MQ Clustering - Load Balancing.

Hardware clustering - High Availability. For example - using Microsoft clustering service on Windows 2003 Enterprise edition.

Messages can be picked up only from local queues/queue manager one is connected to.

This would mean the following -

Message can be sent to a shared/clustered queue. This shared queue automatically balances the load across multiple machines.

Questions -

Does the MQ cluster balances connections or messages. For example - if I send 1000 messages at a MQ cluster of 2 machines, will 500 messages be automatically sent to each queue.

So far the only .NET code I came across connects to a particular queue manager and sends the messages to a queue on the same. Will the code for sending messages to the clustered queue be the same. Shouldn't there be some code in which we should not have to specify the queue manager name as explicitly defining the queue manager name/host name etc ties us to a specific machine.

Any links to samples/code would be most helpful.

Thanks so much in advance.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue May 06, 2008 12:42 am    Post subject: Re: Thanks. Have some more questions Reply with quote

Grand High Poobah

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

Varun wrote:
Message can be sent to a shared/clustered queue. This shared queue automatically balances the load across multiple machines.


Not strictly. The queues are not shared, but the queue managers will determine which of the discrete queues will receive the message.


Varun wrote:
Does the MQ cluster balances connections or messages. For example - if I send 1000 messages at a MQ cluster of 2 machines, will 500 messages be automatically sent to each queue.


All connections are to a given queue manager. Messages are balanced, and by default go round robin between each of the possible targets. If you have 1000 messages and 2 possible targets, you'd get 500ish on each (though they'd all go somewhere). If you added a third queue, you'd get 333ish on each.

WMQv6 allows you to configure this distribution, provided all queue managers in the cluster are v6. Note also that by default, if you connect to a queue manager that hosts a possible target, all the messages will go to that.

Varun wrote:
So far the only .NET code I came across connects to a particular queue manager and sends the messages to a queue on the same. Will the code for sending messages to the clustered queue be the same.


Yes

Varun wrote:
Shouldn't there be some code in which we should not have to specify the queue manager name as explicitly defining the queue manager name/host name etc ties us to a specific machine.


No. All applications connect to a specific queue manager, which may or may not participate in a cluster.

There are various techniques for making the connection less specific, which have nothing to do with clusters and might not be approriate to your situation. Check the Clients manual.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue May 06, 2008 6:45 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9472
Location: US: west coast, almost. Otherwise, enroute.

Quote:
Can anyone please point me to some sample code which I can use connect/send message to a shared/clustered queue. ...I am hoping that a shared clustered queue across machines acts as a single queue. ...If a particular machine would fail, the active machine would carry on processing.


Shared Queues is a z/OS (mainframe) WMQ implementation; and a wonderful thing it is. Shared Queues provide exactly what you are looking for, namely: if a qmgr fails, other qmgr(s) can process the message. Shared queues have nothing to do with clustered queues.

In z/OS, an application can connect to a qmgr OR a queue-sharing group (of qmgrs). For other platforms, an application must connect to a qmgr in order to put/get a message.
_________________
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
View user's profile Send private message
Vitor
PostPosted: Tue May 06, 2008 7:13 am    Post subject: Reply with quote

Grand High Poobah

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

bruce2359 wrote:
Shared Queues is a z/OS (mainframe) WMQ implementation; and a wonderful thing it is. Shared Queues provide exactly what you are looking for, namely: if a qmgr fails, other qmgr(s) can process the message. Shared queues have nothing to do with clustered queues.

In z/OS, an application can connect to a qmgr OR a queue-sharing group (of qmgrs). For other platforms, an application must connect to a qmgr in order to put/get a message.


I think it's wrong to taunt a poster who's admitted he's condemed to use Windoze with the glory that is z/OS.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue May 06, 2008 7:19 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9472
Location: US: west coast, almost. Otherwise, enroute.

Quote:
I think it's wrong to taunt a poster ...


Not my intent. If Varun's organization has a business requirement that demands what WMQ for z/OS provides, then it's not taunting.

All platforms have their benefits. z/OS has a few more.
_________________
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
View user's profile Send private message
PeterPotkay
PostPosted: Tue May 06, 2008 9:20 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

bruce2359 wrote:
Shared queues have nothing to do with clustered queues.

Although you can cluster shared queues.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue May 06, 2008 10:02 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9472
Location: US: west coast, almost. Otherwise, enroute.

Quote:
Although you can cluster shared queues.

On a mainframe all things are possible.
_________________
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
View user's profile Send private message
Vitor
PostPosted: Wed May 07, 2008 1:14 am    Post subject: Reply with quote

Grand High Poobah

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

bruce2359 wrote:
On a mainframe all things are possible.


It's so, so beautiful.....


_________________
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 Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Use .NET to send message to MQ Cluster
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.