Page 1 of 1

MQ_connector

Posted: Fri Mar 20, 2015 10:06 am
by Gius
hello,
I created a job that read from a queue with an MQ_connector.
This job run once.

But there is a way that this job stay up always, like a listen mode and when there is a message in the queue, then this job is executing ?

Thank you

Posted: Fri Mar 20, 2015 11:29 am
by eostic
Look thru the documentation on the properties and their defaults and available values. There is a wait time property that when set to -1, means "wait indefinitely". NOT a good idea during testing and understanding the Stage. There is also a message limiter. When first starting I make these values 30 and 10 respectively. Don't make the timeout -1 until you are fully familiar with the Stage and have learned how to force it to stop cleanly (there is a message type you can specify for clean shutdown, a subject for another topic).

Ernie

Posted: Fri Mar 20, 2015 12:40 pm
by chulett
Here I was thinking it would need to be a service but then I thought... heck, I'll just wait for Ernie. :wink:

Posted: Fri Mar 20, 2015 3:22 pm
by eostic
What is interesting is that Waittime defaults to -1 (wait forever)....and usually developers will accidentally leave it this way and wonder why the Job never stops. ; )

As noted above, always start your work with the MQ Connector with waittime at 30 and message quantity at (say) 10.

Ernie

Posted: Fri Mar 20, 2015 5:36 pm
by JRodriguez
Another cool alternative is to use the trigger mechanism in the MQ manager to execute your DS job base on the arrival of the first message to the queue... this works like a charm.