Question

MQ Trigger (IBM Websphere MQ)

Asked by: chillu71

Hi,

We are planning to use dynamic queues as part of our MQ solution. We are at a road block now because we are not sure if MQ trigger can be triggered for a dynamic queue. I would appreciate it if anyone out there let us know if trigger can be used on dynamic queue. If yes, could you let us know the procedure? Thanks

Sri

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2005-12-19 at 21:46:21ID21670211
Tags

mq

,

trigger

,

websphere

,

EAI

Topic

Enterprise Software

Participating Experts
1
Points
175
Comments
11

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Newbie in Websphere MQ and C#
    Hi Experts, I'm really new in IBM Websphere MQ. May I know basically what does this IBM Websphere MQ does? I have search throught IBM websites and also codeproject, all they shows me is basically some kind of Middleware where using Message to integrate applications with appl...
  2. Websphere MQ Compression
    My queue manager is loacted in Country A and my MQ Client is located in Country B. I will like to improve MQ Performance by using Channel Compression. How do I turn on Websphere MQ Channel compression? What are the advantages / disadvantages of using Websphere MQ channel com...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: dqmqPosted on 2005-12-21 at 00:36:47ID: 15524765

It's a little bit of an odd request, but I don't see why it wouldn't work.  Setup the triggering-related parameters on the model queue (that you will open to instantiate the dynamic queue).  I doubt I can remember all of them off the top of my head, but you would certainly need to specify TRIGTYPE, an INITQ, and set TRIGGER ON.  You also need to define an INITQ and start a trigger monitor that listens for messages on the INITQ.

 

by: chillu71Posted on 2005-12-21 at 01:31:42ID: 15524902

hi dqmq,

Will this work if I am creating say 10 dynamic queues using the model queue. How does the trigger know when to fire and for which queue? I appriciate your help.

 

by: dqmqPosted on 2005-12-21 at 13:08:21ID: 15529858

First, I have my docs now, so here's a little more specific:

Define QModel with:
TRIGGER
PROCESS=name of process  
USAGE=NORMAL
TRIGTYPE=FIRST  (99% of applications)
INITQ=name of initq

Define INITQ like any other QLocal
Define PROCESS to describe how to start  triggered application
Start trigger monitor against INITQ

Now, to followup questions:
>Will this work if I am creating say 10 dynamic queues using the model queue.
Yes, there is no limit.

>How does the trigger know when to fire and for which queue?
To get this working you need to COMPLETELY understand the list of trigger conditions that is described in the programmers guide.

When trigger conditions are satisified on a QUEUE, MQ's triggering mechanism places a trigger message in the INITQ that was inherited from the QMODEL definition.  The trigger message contains the name of the triggered QUEUE plus the APPLICID and other information from the PROCESS definition.

The trigger monitor which has a "hot-read" on the INITQ, then wakes up immediately and reads the trigger message.  It uses the information in the trigger message to start the triggered application, passing it the trigger message.

The triggered application can then extract the name of the QUEUE from the trigger message.

A couple words of caution:
A trigger message is associated with a queue, NOT a specific application message.  It means one thing, and one thing only: that trigger conditions for that queue were momentarily satisfied.  That implies: 1) the triggered application must be able to tolerate not finding any messages on the queue 2) the triggered application must process the queue until empty (casually referred to as "draining the queue").

Triggering works great and is pretty much maintenance free if it is used as intended and set up properly.  But trying to contort it into something it was not designed for, while sometimes appealing, is a common pitfall and usually leads to much agony and hatred for triggering itself.  Triggering is not the problem; misuse is.

Eventually, it's more than likely that you will want the trigger monitor and the triggered application to run in background. In other words, without a console or other status display. Therefore, it must have robust error handling and ways to communicate errors when they occur.  Plan for that.

Get triggering working on a permanent queue first, then switch over to dynamic queue.

Get the process working with the trigger monitor and the triggered application running in foreground so you can "see" what is happening.  Switch them into background only after you are comfortable with how everything works.

Apply the KISS prinicple religiously. Increase complexity and sophistication gradually as you are more comfortable with the mechanics of triggering.

Avoid TRIGTYPE=EVERY. Anything that can be done with EVERY can be done better and easier another way.  Remember what a trigger message means:  that trigger conditions for that queue were momentarily satisfied. Why would you care to know that more than once at the same time?

Finally, triggering implementations vary slightly for each platform/environment.  If you have a followup question, please imention the environment you are using.




 


 

by: chillu71Posted on 2005-12-22 at 22:22:19ID: 15540277

Thanks for such an elaborate answer. I thought if I could give you the exact scenario then it might set things straight and you could let me know if the approach we are taking is or is not a right one.

Before I go any further, we are working in windows environment (windows server 2003)

Incoming message scenario:
At any given time MQ could receive close to tens of thousands of messages. Each message is from a unique customer (each customer is identified by unique id). We are planning have multiple local queues to handle the incoming messages. These messages are pushed to the business tier for further processing. This operation is pretty straight forward.

Outgoing message scenario: (This is where we need an answer)
In our solution we automatically connect to our customer to process his request. As I said each customer is identified by their unique id. What we intend to do is to create a dynamic queue for each customer. Part of dynamic queue name will have the customer id. (note; outgoing messages will not be as many as incoming). So as an example, we might create a thousand dynamic queues. Once a message arrives in this dynamic queue we need a trigger that will start a process. This process will get the customer id from the dynamic queue name and connect with the customer to complete the process. Is this an healthy approach? Do you have any suggestion? Let me know if you didn't follow any of this info.

Thanks!

 

by: dqmqPosted on 2005-12-23 at 15:26:55ID: 15545178

My first reaction is that the dynamic queues and the triggers are additional overhead and unnecessary complexity. I will elaborate further when I have a little more time.  But in the meantime, a couple of questions for you:

1. Do you intend to use permanent dynamic queues or temporary dynamic queues?
2. At what point in the process do you create the dynamic queue?
3. Describe briefly what you mean by "automatically connect"?  Is that a scheduled event or is it driven by something else?
4. How much time between automatically connecting to pickup messages and connecting to send back the replies?
5. Are the tens of thousands of messages related to one another (other than they came from the same customer) or does each one represent a "standalone" request.  I mean do you need to collect multiple messages to process one request or does each message represent a request by itself?






 

by: dqmqPosted on 2005-12-23 at 23:35:48ID: 15546151

To get messages back you will ordinarily need an XMITQ for each customer.  So, you tell me, what is the point of writing responses to a dynamic queue, then triggering an application to immediately move them to the XMITQ?

The usual method is simply to send the responses back to REPLYTOQUEUE and REPLYTOQMGR which are provided by the originator of the request.  Administratively, either by XMITQ naming convention or by use of qmgr alias, those messages end up in the XMITQ destined for the right customer.  The XMITQ can be triggered so it will automatically startup the channel and begin shipping responses as soon as they appear. NO need for a dynamic queue and no need for a triggered application to process it.




 



 

by: chillu71Posted on 2006-01-02 at 22:49:48ID: 15596772

Answers to your questions are as follows:

1. Do you intend to use permanent dynamic queues or temporary dynamic queues?
A. Yes we intend to use permanent dynamic queue. We thought of using temporary dynamic queue but messages might come into the queue at different intervals. So this makes us to think about your suggestion of using XMITQ.

2. At what point in the process do you create the dynamic queue?
A. They are created when we want to send out a response to the customer's request. The actual process is asynchronous. First, customer would send a request. This request would have the name of the dynamic queue to be created. Once the request is received the customer is no longer in the picture. The mid-tier process the request (using DB and other services). Once the response is generated, one mid-tier process calls the customer to come and get the response and the other process creates the dynamic queue and posts the response. Customer would come and read the response in the corresponding dynamic queue. (This is the intended solution)

3. Describe briefly what you mean by "automatically connect"?  Is that a scheduled event or is it driven by something else?
A It is driven by a mid-tier component.

4. How much time between automatically connecting to pickup messages and connecting to send back the replies?

A. This depends on the customer. If the customer is busy then the process would wait and retry until the customer is free.

5. Are the tens of thousands of messages related to one another (other than they came from the same customer) or does each one represent a "standalone" request.  I mean do you need to collect multiple messages to process one request or does each message represent a request by itself?

A. There could be multiple requests from a single customer at the same time. But the requests are different between customers.

Hope this gives you a good understanding of the process. We need to do more research on XMITQ. Sounds like a good suggestion. I would appreciate if you could explain XMITQ process in more detail. How different is this than the standard local queue? Will there be 'n' number of XMITQ's each representing a customer?

 

by: dqmqPosted on 2006-01-03 at 01:28:14ID: 15597321

Whenever I hear someone planning to use permanent dynamic queues, I get suspicious. Legitimate uses for them are rare.  I also do not like the idea, nor see any good reason for the customer to send the name of the dynamic queue for you to create.   If anything, the customer creates the dynamic queue then sends you the name so you know where to send the reply. It does no good for you to create the dynamic queue on your end because the customer cannot retrieve messages from there.

By "customer", I'm referring to a distributed queing partner.  It occurs to me that before I go off on too much of a rant, that you should clarify what you mean by a "customer".   Do your customers connect locally to your qmgr,  do they have channel connections, or are your customers connecting as MQ Clients?  Does each customer have a unique qmgr or is each customer a different user on the same qmgr?

Any two qmgrs exchange messages over channel pairs.   An XMITQ is the local queue that feeds an outbound channel.  Whenever you put a message to a remote destination, it gets queued locally first in an XMITQ.  Your qmgr MUST have an XMITQ for every adjacent qmgr it connects with.

 

by: chillu71Posted on 2006-01-04 at 03:28:28ID: 15606729

Customers/Clients use our webservices to send updates and requests. Webservices inturn connect to our local Q Mgr and PUTs message. Updates/requests come in at regular intervals. These requests are then pushed to the middle tier. Here we identify the customer and we intend to create a dynamic queue for that customer and PUT our response on the queue (after the response is generated, this is were the process I mentioned in my previous comment would send a request to the customer (with queue name) to collect the response and also PUTs the response in the dynamic queue created). Once the customer is ready to accept the response for the request, customer connects to the webservice and passes the queue name. Webservice knows which queue to find and gets the response back to the customer. Communication is always going to be through our local Q Mgr.

 

by: dqmqPosted on 2006-01-04 at 13:57:03ID: 15612170

OK, the fog is beginning to lift. I misunderstood your sense of "connecting" with the customer.  As I understand it now, the customer connections are done by WebServices, not MQ. But I'm still a little fuzzy about what kind of notification you intend to send to the customer that the response is ready.  Please clarify.  

I'm also interested if multiple responses might appear in the same dynamic queue at one time. When the WebService connects to pick up a response, does it need to distinguish responses for one request from responses for another? Is a typical "response" a single message, a few messages, or a whole bunch of them?

My discussion about XMITQ's does not apply to you since you don't have channel connections with your customers.

Your original question was about triggering: can you trigger a dynamic queue. Yes. Lot's of them, if you want. Each triggered process is passed the trigger message so it can know what queue to go after.

Does it make sense to trigger a process that notifies the customer that a response is waiting?  I'm afraid you will have lots of struggles with that paradigm. There is no relationship between a trigger and a message. A trigger is related to a queue.  Unless the queue can only contain a single response, then there is no relationship between a trigger and a response, either. The triggered program needs to open the dynamic queue and keep it open until it is empty. Now, that's not necessarily a show stopper, but it does imply dozens or hundreds or more triggered processes hanging around while customers are busy.

If you're going to use triggering, adopt this mindset: the triggered program reads the triggered queue, determines what constitutes a response, to which customer, and then notifies the customer. That process continues in a loop until the queue is empty. Also, I'd prefer to get the customer identity from the reply message rather than the queue name, as that gives you more flexibility by not locking you down to one queue per customer.

BTW, this thread is getting old and it's beginning to drop off my radar scope. I'm glad to advise further, but suggest we email direct since no-one else is participating, anyway.

millerdq@verizon.net

regards,
Dennis

 

by: chillu71Posted on 2006-01-05 at 04:09:25ID: 15617095

I have sent an email to millerdq@verizon.net

Thanks

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...