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 » How to repilcate messages from one queue to other queues

Post new topic  Reply to topic
 How to repilcate messages from one queue to other queues « View previous topic :: View next topic » 
Author Message
themqstudent
PostPosted: Wed Aug 24, 2011 10:39 am    Post subject: How to repilcate messages from one queue to other queues Reply with quote

Novice

Joined: 26 May 2011
Posts: 22

Hello Team,

On my current installation, the previous MQ Admin setup an environment to replicate messages from one queue to two other queues as fallows:

Assume we have three queues: aaq0, aaq1 and aaq2. All three queues resides on an AIX server, which is running WMQ 7.0.1.

Remote clients put messages on the first queue, aaq0.
We have an MQ C program running constantly waiting for the arrivals of messages to aaq0.

Once a message arrives the C client gains control and:

Gets the message from aaq0.
Writes a copy of the message to aaq1 and to aaq2.
In due time, the appropriate applications will consume the messages on aaq1 and aaq2.

Although this works fine, we do this for each type zero (0) queues.
The issue is that we have a large number of q0 queues and so we have the same number of C programs on the server running. In other words, for each q0 that we want to replicate, we start a copy of the C program, which replicates to the other two queues, q1 and q2. The program is also written in such a way that if either q1 or q2 is full, it terminates. This causes a problem because q0 might become full.
Sure I can make q0 very large and it is 2.5 millions today. But you also need storage to hold messages.....

I looked into using broker: Publisher/Subscriber but I concluded that this was not the purpose of that function.

I also look into q alias, but concluded that this also is not the solution...I think.

My question to the WMQ community is:

Do you know of a way to have messages arriving at the first queue, q0 be moved simultaneously to the other two queues, q1 and q2?

Thank you
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Aug 24, 2011 10:43 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Yes, there is an easy way.

It is found in the documentation, and is covered in the basic training you should have already taken.

Since you are an mq student, you should be excited at the opportunity to increase your knowledge by reading the documentation, which you have of course made a link to and kept handy so that you could always find it at a moment's notice.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Aug 24, 2011 10:46 am    Post subject: Re: How to repilcate messages from one queue to other queues Reply with quote

Grand High Poobah

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

themqstudent wrote:
I looked into using broker: Publisher/Subscriber but I concluded that this was not the purpose of that function.


How did you reach that conclusion? It's certainly one of the purposes of that. And using WMQv7 as you are, you don't need broker; WMQv7 itself has the only pub/sub engine (the WMBv7 broker pub/sub uses the underlying WMQ engine).

themqstudent wrote:
I also look into q alias, but concluded that this also is not the solution...I think.


No, it's not.

themqstudent wrote:
Do you know of a way to have messages arriving at the first queue, q0 be moved simultaneously to the other two queues, q1 and q2?


Another common solution is to use something like the mirrorq exit. I repeat (again) that as supplied it is a sample and you're responsible for making it robust enough to run in your production environment and responsible when it blows.

(I also mention the usual comments about exits being advanced WMQ).

<plug>The sponsors of this forum make a commercial equivalent of mirrorq, which is production strength and supported</plug>

A search of the forum would have turned all this up. Duplicating messages like this is an often discussed topic in here.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mvic
PostPosted: Wed Aug 24, 2011 12:54 pm    Post subject: Re: How to repilcate messages from one queue to other queues Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

themqstudent wrote:
The program is also written in such a way that if either q1 or q2 is full, it terminates. This causes a problem because q0 might become full.

IMHO, really you need to improve the error handling logic in that app. Maybe it should sleep a while, then retry, rather than just terminating.

I suggest you also need to discover why q1 or q2 get full.

I think there is nothing wrong with the idea of running the q0 getter app as you describe, provided you improve its ability to deal with problem situations as above. I am not really sure I understand why you would want to change anything else about it.

If your messages are persistent, ensure you put/get them inside units of work to avoid losing messages in error scenarios.
Back to top
View user's profile Send private message
themqstudent
PostPosted: Fri Aug 26, 2011 1:08 pm    Post subject: Re: How to repilcate messages from one queue to other queues Reply with quote

Novice

Joined: 26 May 2011
Posts: 22

I will try to reply in the same order as I received each post to my question.
But first, I want to thanks everyone for your help.

To: mqjeff
I have not taken any WMQ training other than reading a bunch of IBM Redbooks and web information. Sure I am excited about learning WMQ and if you recommend any reading I will read it.

To Vitor:
I concluded that pub/sub was not the solution based on what I understood (not much) of the subject. I will look into your suggestion of using mirrorq exit. I am sorry about the dup msgs.

To mvic:
I agree, error handling on my current apps is not as it should be. We'll look into that.
When one of the queues gets full, it is very often due to the consumer not consuming the msgs timely.
All the msgs are persistent. They eventually go into a DB2 database.

Again, thanks to all!
Back to top
View user's profile Send private message
bruce2359
PostPosted: Fri Aug 26, 2011 4:50 pm    Post subject: Reply with quote

Poobah

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

IBM offers an excellent 4-day WMQ System Administration class - lecture and hands-on lab exercises - WM201 for Windows, WM202 AIX, WM203 Linux. Course content is identical for all three; lab exercises are performed on the o/s of your choice.

There is a separate 4-day course for WMQ for z/OS System Administration (WM300).

Here's the url for the Windoze version of the course:
http://www-304.ibm.com/jct03001c/services/learning/ites.wss/us/en?pageType=course_description&courseCode=WM201
_________________
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
RogerLacroix
PostPosted: Fri Sep 02, 2011 3:40 pm    Post subject: Re: How to repilcate messages from one queue to other queues Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3253
Location: London, ON Canada

themqstudent wrote:
On my current installation, the previous MQ Admin setup an environment to replicate messages from one queue to two other queues as fallows:

Assume we have three queues: aaq0, aaq1 and aaq2. All three queues resides on an AIX server, which is running WMQ 7.0.1.

Sounds like something I have done many different times for various companies.

I use MMX (Message Multiplex) to copy/replicate the messages to the target queues.

What you appear to be missing is a nighty task to clear the queues. i.e. You can use ClearQ or EmptyQ to do the job. Just use your OS scheduler to launch the program at whatever time you want the queue cleared.

- ClearQ issues the CLEAR_Q PCF command (which will not work if the queue is opened)
- EmptyQ performs destructive gets against the queue until it is empty

Regard,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
mqjeff
PostPosted: Sat Sep 03, 2011 4:21 am    Post subject: Re: How to repilcate messages from one queue to other queues Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

RogerLacroix wrote:
themqstudent wrote:
On my current installation, the previous MQ Admin setup an environment to replicate messages from one queue to two other queues as fallows:

Assume we have three queues: aaq0, aaq1 and aaq2. All three queues resides on an AIX server, which is running WMQ 7.0.1.

Sounds like something I have done many different times for various companies.


Probably. The proper method to do this with MQ v7 is to use Pub/Sub. And then re-examine all business requirements that require duplicated messages but can't work with pub/sub.
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 » How to repilcate messages from one queue to other queues
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.