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 » General IBM MQ Support » Unable to run DLQ-Handler as a service

Post new topic  Reply to topic Goto page Previous  1, 2, 3
 Unable to run DLQ-Handler as a service « View previous topic :: View next topic » 
Author Message
exerk
PostPosted: Tue Oct 01, 2019 6:12 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

HubertKleinmanns wrote:
exerk wrote:
...but I'm not sure what you mean by '...calls "runmqdlq" in a loop...'.


My idea was, that the wrapper script calls "runmqdlq", waits a few seconds, calls it again, waits a few seconds, etc. Something like this:

Code:

while [ 1 ]
do
   runmqdlq ...

   sleep 5
done


This script wouldn't end when the DLQ has been GET(DISABLED). It would just call the DLQ handler again and again.

What's wrong with runmqdlq $1 $2 < $3 and WAIT(YES) in the rules file?

A lot less hassle than calling it every 5 seconds...
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
HubertKleinmanns
PostPosted: Tue Oct 01, 2019 6:28 am    Post subject: Reply with quote

Shaman

Joined: 24 Feb 2004
Posts: 732
Location: Germany

exerk wrote:
What's wrong with runmqdlq $1 $2 < $3 and WAIT(YES) in the rules file?

A lot less hassle than calling it every 5 seconds...


There is nothing wrong with it. Your wrapper could be implemented as a service of type COMMAND, which could be started, but not stopped (except by disabling the DLQ):

I myself would prefer, to trigger the DLQ and run the DLQ handler (or a wrapper around) as a triggered application.

Others could run the DLQ handler via scheduler or on demand manually.

But saurabh25281 wants to have a service of type SERVER, which could be started and stop via MQSC command (or MQ Explorer) - and my suggestion was just an idea, how this could be implemented.
_________________
Regards
Hubert
Back to top
View user's profile Send private message Visit poster's website
exerk
PostPosted: Tue Oct 01, 2019 6:33 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

HubertKleinmanns wrote:
exerk wrote:
What's wrong with runmqdlq $1 $2 < $3 and WAIT(YES) in the rules file?

A lot less hassle than calling it every 5 seconds...


There is nothing wrong with it. Your wrapper could be implemented as a service of type COMMAND, which could be started, but not stopped (except by disabling the DLQ):

I myself would prefer, to trigger the DLQ and run the DLQ handler (or a wrapper around) as a triggered application.

Others could run the DLQ handler via scheduler or on demand manually.

But saurabh25281 wants to have a service of type SERVER, which could be started and stop via MQSC command (or MQ Explorer) - and my suggestion was just an idea, how this could be implemented.

Mine is definitely SERVER...

Quote:
DEFINE SERVICE ('DEAD.LETTER.HANDLER') +
DESCR('Dead-letter queue automated message handler') +
STARTCMD('/home/mqm/dlqh.sh') +
STARTARG('DEAD.QUEUE +QMNAME+ /home/mqm/dlqh.rul') +
STDOUT('/home/mqm/dlqh_stdout.txt') +
STDERR('/home/mqm/dlqh_stderr.txt') +
CONTROL(STARTONLY) +
SERVTYPE(SERVER) +
REPLACE

_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
HubertKleinmanns
PostPosted: Tue Oct 01, 2019 6:59 am    Post subject: Reply with quote

Shaman

Joined: 24 Feb 2004
Posts: 732
Location: Germany

exerk wrote:
Mine is definitely SERVER...

Quote:
DEFINE SERVICE ('DEAD.LETTER.HANDLER') +
DESCR('Dead-letter queue automated message handler') +
STARTCMD('/home/mqm/dlqh.sh') +
STARTARG('DEAD.QUEUE +QMNAME+ /home/mqm/dlqh.rul') +
STDOUT('/home/mqm/dlqh_stdout.txt') +
STDERR('/home/mqm/dlqh_stderr.txt') +
CONTROL(STARTONLY) +
SERVTYPE(SERVER) +
REPLACE

I wrote "could be ..." . Of course type SERVER is better, because you are able to monitor the status of the service (and eventually restart it). This is not possible with type COMMAND. This was just an idea .

There are many ways to reach the goal .
_________________
Regards
Hubert
Back to top
View user's profile Send private message Visit poster's website
saurabh25281
PostPosted: Tue Oct 01, 2019 10:07 am    Post subject: Reply with quote

Centurion

Joined: 05 Nov 2006
Posts: 107
Location: Bangalore

exerk wrote:

Mine is definitely SERVER...

Quote:
DEFINE SERVICE ('DEAD.LETTER.HANDLER') +
DESCR('Dead-letter queue automated message handler') +
STARTCMD('/home/mqm/dlqh.sh') +
STARTARG('DEAD.QUEUE +QMNAME+ /home/mqm/dlqh.rul') +
STDOUT('/home/mqm/dlqh_stdout.txt') +
STDERR('/home/mqm/dlqh_stderr.txt') +
CONTROL(STARTONLY) +
SERVTYPE(SERVER) +
REPLACE

Did you try stopping the service and did it work?
The reason I am asking is, that I found that the wrapper has a different process id than the runmqdlq process that runs as a child process.
When you try to Stop the service using the amsstop command it would not be able to stop the runmqdlq process and end with an error "No active connections for process(<PID>)".
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
exerk
PostPosted: Tue Oct 01, 2019 11:45 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

saurabh25281 wrote:
exerk wrote:

Mine is definitely SERVER...

Quote:
DEFINE SERVICE ('DEAD.LETTER.HANDLER') +
DESCR('Dead-letter queue automated message handler') +
STARTCMD('/home/mqm/dlqh.sh') +
STARTARG('DEAD.QUEUE +QMNAME+ /home/mqm/dlqh.rul') +
STDOUT('/home/mqm/dlqh_stdout.txt') +
STDERR('/home/mqm/dlqh_stderr.txt') +
CONTROL(STARTONLY) +
SERVTYPE(SERVER) +
REPLACE

Did you try stopping the service and did it work?
The reason I am asking is, that I found that the wrapper has a different process id than the runmqdlq process that runs as a child process.
When you try to Stop the service using the amsstop command it would not be able to stop the runmqdlq process and end with an error "No active connections for process(<PID>)".

To stop it I GET(DISABLED) the queue.

If you want it to start when the DLQ depth is > 0, then trigger it. At that point you can either have the DLQ Handler wait indefinitely once it's been triggered with WAIT(YES), or have it end after the last message is cleared and close down with WAIT(NO).

Pretty much the only time I run a DLQ Handler as a service is in Dev, so I don't have to keep clearing down the DLQ. In Prod, either I have it triggered and an alert generated, or a manual process after an alert is received. It all depends on your site requirements/standards.
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
HubertKleinmanns
PostPosted: Tue Oct 01, 2019 11:20 pm    Post subject: Reply with quote

Shaman

Joined: 24 Feb 2004
Posts: 732
Location: Germany

exerk wrote:
If you want it to start when the DLQ depth is > 0, then trigger it. At that point you can either have the DLQ Handler wait indefinitely once it's been triggered with WAIT(YES), or have it end after the last message is cleared and close down with WAIT(NO).

Pretty much the only time I run a DLQ Handler as a service is in Dev, so I don't have to keep clearing down the DLQ. In Prod, either I have it triggered and an alert generated, or a manual process after an alert is received. It all depends on your site requirements/standards.



_________________
Regards
Hubert
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3 Page 3 of 3

MQSeries.net Forum Index » General IBM MQ Support » Unable to run DLQ-Handler as a service
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.