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 1, 2, 3  Next
 Unable to run DLQ-Handler as a service « View previous topic :: View next topic » 
Author Message
saurabh25281
PostPosted: Sun Sep 29, 2019 1:15 pm    Post subject: Unable to run DLQ-Handler as a service Reply with quote

Centurion

Joined: 05 Nov 2006
Posts: 107
Location: Bangalore

Hi All,

We are using MQv9.1 and trying to setup a DLQ handler as a MQ service on RHEL platform.

Below is my service definition
Code:
DEFINE SERVICE(DLQH) +
SERVTYPE(SERVER) +
CONTROL(QMGR) +
STARTCMD('+MQ_INSTALL_PATH+bin/runmqdlq') +
DESCR('dlqhandler service') +
STARTARG('+QMNAME+.DLQ +QMNAME+ </home/mqm/mq-dlh/mq-dlh.rul') +
STOPCMD('+MQ_INSTALL_PATH+bin/amqsstop') +
STOPARG('-m +QMNAME+ -p +MQ_SERVER_PID+') +
STDOUT('/var/mqm/qmgrs/+QMNAME+/errors/dlqh.log') +
STDERR('/var/mqm/qmgrs/+QMNAME+/errors/dlqh.err') +
REPLACE


However, when I start the service i get the below error in the dlqh.err log.
Quote:
AMQ8758E: 1 errors detected in input to runmqdlq.
AMQ8709I: Dead-letter queue handler ending.


As someone suggested in the link, that the above error is due to missing end-of-line in the rule table, I verified the .rul file and it had the end-of-line character.
To make sure that the rule file was not the culprit, I ran the DLQ handler directly on the server as below and it worked fine.
Quote:
/opt/mqm/bin/runmqdlq MYQMGR.DLQ MYQMGR < /home/mqm/mq-dlh/mq-dlh.rul
AMQ8708I: Dead-letter queue handler started to process INPUTQ(MYQMGR.DLQ).


Attaching my mq-dlh.rul file
Code:
inputqm(' ')  inputq(' ')   

DESTQ(INITQ.*) FORMAT('MQTRIG  ') +
  REASON(MQRC_Q_FULL) ACTION(DISCARD) RETRY(5)   
REASON(MQRC_Q_FULL) ACTION(RETRY) RETRY(5)   

REASON(MQRC_PUT_INHIBITED) ACTION(RETRY) RETRY(5)   

MSGTYPE(MQMT_REQUEST) REPLYQM(AAAA.*) +
  ACTION(FWD) FWDQ(DEADQ) FWDQM(&REPLYQM)   

DESTQM(bbbb.1) +
  action(fwd) fwdq(&DESTQ) fwdqm(bbbb.2) header(no)   

REPLYQM(CCCC.*) +
  ACTION(FWD) FWDQ(ALARM) FWDQM(CCCC.SYSTEM)



Can someone tell me where I am going wrong.

Thanks
Saurabh
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
exerk
PostPosted: Sun Sep 29, 2019 2:11 pm    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

Look hard at the service definition and what you entered on the command line:

'</home/mqm/mq-dlh/mq-dlh.rul' is different to '< /home/mqm/mq-dlh/mq-dlh.rul'
_________________
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
saurabh25281
PostPosted: Sun Sep 29, 2019 3:02 pm    Post subject: Reply with quote

Centurion

Joined: 05 Nov 2006
Posts: 107
Location: Bangalore

exerk wrote:
Look hard at the service definition and what you entered on the command line:

'</home/mqm/mq-dlh/mq-dlh.rul' is different to '< /home/mqm/mq-dlh/mq-dlh.rul'

The space after '<' doesn't make any difference to the outcome i.e.
1. If i remove the space after < in command line, it still works.
2. If i add a space in the service definition after <, it still doesn't work.

Regards
Saurabh
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
gbaddeley
PostPosted: Sun Sep 29, 2019 4:13 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2492
Location: Melbourne, Australia

Quote:
STARTARG('+QMNAME+.DLQ +QMNAME+ </home/mqm/mq-dlh/mq-dlh.rul') +

Does startarg actually support a stdin specification???

We don't invoke 'runmqdlq' directly, its inside a wrapper script.
Also, we use a process object rather than service object, which is triggered by first msg on the DLQ. It waits 60 secs for new msgs then terminates.
_________________
Glenn
Back to top
View user's profile Send private message
HubertKleinmanns
PostPosted: Sun Sep 29, 2019 11:33 pm    Post subject: Reply with quote

Shaman

Joined: 24 Feb 2004
Posts: 732
Location: Germany

In the past on Windows the rule table required an empty line after the last rule at the end of the file. I don't know if this is still necessary.
_________________
Regards
Hubert
Back to top
View user's profile Send private message Visit poster's website
exerk
PostPosted: Sun Sep 29, 2019 11:41 pm    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

gbaddeley, good point! Like you I use a wrapper script and have used a triggered DLQ in the past. Depending on customer requirement/request/mandate, I now use either, or manual intervention.

saurabh25281, if you wish it to be a Service definition, try:

Code:
STARTCMD('/home/mqm/mq-dlh/mq-dlh.sh') +
STARTARG('+QMNAME+.QUEUE +QMNAME+ /home/mqm/mq-dlh/mq-dlh.rul')


The content of the script can be as simple as:

Code:
#!/bin/bash
echo $1 $2 $3
echo Started `date '+%Y%m%d %H%M%S'`
runmqdlq $1 $2 < $3


And in the rules file:

Code:
* Control Information

RETRYINT(30) WAIT(YES)

* Specific Rules
(Your rules here)

_________________
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
exerk
PostPosted: Sun Sep 29, 2019 11:45 pm    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

HubertKleinmanns wrote:
In the past on Windows the rule table required an empty line after the last rule at the end of the file. I don't know if this is still necessary.

According to THIS, yes. For portability I always include a blank line in Unix-based rules files too as it doesn't seem to make any difference to its operation.
_________________
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
bruce2359
PostPosted: Mon Sep 30, 2019 3:37 am    Post subject: Reply with quote

Poobah

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

exerk wrote:
HubertKleinmanns wrote:
In the past on Windows the rule table required an empty line after the last rule at the end of the file. I don't know if this is still necessary.

According to THIS, yes. For portability I always include a blank line in Unix-based rules files too as it doesn't seem to make any difference to its operation.

The (platfiorm-specific) requirement was for an and-of-line CR/LF (or equivalent) on the last line.
_________________
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
HubertKleinmanns
PostPosted: Mon Sep 30, 2019 3:56 am    Post subject: Reply with quote

Shaman

Joined: 24 Feb 2004
Posts: 732
Location: Germany

bruce2359 wrote:
exerk wrote:
HubertKleinmanns wrote:
In the past on Windows the rule table required an empty line after the last rule at the end of the file. I don't know if this is still necessary.

According to THIS, yes. For portability I always include a blank line in Unix-based rules files too as it doesn't seem to make any difference to its operation.

The (platfiorm-specific) requirement was for an and-of-line CR/LF (or equivalent) on the last line.


That's what IBM writes in the knowledge center:
Quote:
On Windows systems, the last rule in the table must end with a carriage return/line feed character. You can achieve this by ensuring that you press the Enter key at the end of the rule, so that the last line of the table is a blank line.

So an empty line doesn't hurt .
_________________
Regards
Hubert
Back to top
View user's profile Send private message Visit poster's website
saurabh25281
PostPosted: Mon Sep 30, 2019 3:59 am    Post subject: Reply with quote

Centurion

Joined: 05 Nov 2006
Posts: 107
Location: Bangalore

1. I tried creating the MQ service in my Windows machine with startarg and it worked perfectly fine. So I guess it should work Linux too.
Code:
SERVICE(S1)                             CONTROL(MANUAL)
SERVTYPE(SERVER)
STARTCMD(C:\Users\myuser\Documents\runmqdlq\mqdlqh.bat)
STARTARG(DLQ QM2 <C:\Users\myuser\Documents\runmqdlq\dlh.rul)
STOPCMD(+MQ_INSTALL_PATH+bin64\amqsstop)
STOPARG(-m +QMNAME+ -p +MQ_SERVER_PID+)

Code:
runmqdlq.exe %1 %2 %3


2. We want to trigger the runmqdlq directly, not as a wrapper, because we want to configure the stop service as well.
If we use a wrapper, the stop services is passed with the process id of the wrapper script which the MQ queue manager service amqsstop can't stop.

3. Most of the blogs or knowledge articles I have seen use services for invoking the DLQ-Handler. Below are few of them.
https://developer.ibm.com/answers/questions/333874/how-do-i-configure-the-dead-letter-queue-handler-r/
https://www.ibm.com/developerworks/websphere/library/techarticles/1204_gupta/1204_gupta.html
Again, we chose this option, because we don't want the Handler triggered, but always running as a service.

4. Like I said, i ensured that the end-of-line character is present in the .rul file, but it didnt make any difference and the service would not start. Even though my platform is Linux, i added the end of line and it should not make any difference.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
HubertKleinmanns
PostPosted: Mon Sep 30, 2019 4:36 am    Post subject: Reply with quote

Shaman

Joined: 24 Feb 2004
Posts: 732
Location: Germany

On Linux you should replace the backslashes ("\") by slashes ("/")
_________________
Regards
Hubert
Back to top
View user's profile Send private message Visit poster's website
HubertKleinmanns
PostPosted: Mon Sep 30, 2019 4:37 am    Post subject: Reply with quote

Shaman

Joined: 24 Feb 2004
Posts: 732
Location: Germany

And I guess you won't have a directory starting with "C:" ...
_________________
Regards
Hubert
Back to top
View user's profile Send private message Visit poster's website
saurabh25281
PostPosted: Mon Sep 30, 2019 4:46 am    Post subject: Reply with quote

Centurion

Joined: 05 Nov 2006
Posts: 107
Location: Bangalore

HubertKleinmanns wrote:
And I guess you won't have a directory starting with "C:" ...
On Linux you should replace the backslashes ("\") by slashes ("/")

Please check my initial post. All the Linux/platform based consideration are taken care off.

Regards
Saurabh
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
tczielke
PostPosted: Mon Sep 30, 2019 4:49 am    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
Location: Illinois, USA

If you do the following:

1) strmqtrc -m qmgr -t all -p runmqdlq
2) cause runmqdlq to run
3) endmqtrc -a
4) dspmqtrc - for your trace file

you may get a trace that has more details as to why the AMQ8758E is being reported.

If you use the od command (octal dump) on your mq-dlh.rul file to print the bytes of the file, it might show some helpful diagnostic information, too.
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Sep 30, 2019 4:55 am    Post subject: Reply with quote

Grand High Poobah

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

you did not specify what the access to the rule file was...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2, 3  Next Page 1 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.