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 Installation/Configuration Support » DEFINE PROCESS - user data - parameter substitution

Post new topic  Reply to topic Goto page Previous  1, 2
 DEFINE PROCESS - user data - parameter substitution « View previous topic :: View next topic » 
Author Message
ivanachukapawn
PostPosted: Thu Sep 14, 2006 6:54 am    Post subject: Reply with quote

Knight

Joined: 27 Oct 2003
Posts: 561

you're right Jeff, type=EVERY is not very good either.

So I'm back to attempting to get this scheme to work with type=DEPTH.

I'll have to

#1. parse the TMC2 to produce qName and qmgrName (these automatically supplied by the trigger monitor)

#2. invoke amqsbcg with qName and qmgrName arguments

#3. runmqsc to turn triggering back on for the queue

Do you happen to have example KSH for parsing the TMC2? I've been looking through awk,grep,egrep,sed, etc looking for some easy/robust way of doing this but coming up short so far. One problem is that the TMC2 structure starts out with "TMC 2" immediately followed by the QNAME. It looks like I'd have to hard code a length to get around the structid and version.
Back to top
View user's profile Send private message
scottm
PostPosted: Thu Sep 14, 2006 12:35 pm    Post subject: Reply with quote

Apprentice

Joined: 13 May 2004
Posts: 44
Location: SE Tennessee

So - are some of the receipts possibly not going to be read? But some might be read?

If you set the expiry on the messages, my understanding is that if anything reads the queue, all the expired messages will be removed.

So - if another client will read the queue, then all expired messages will be disgarded. And isn't that what you want?

Why bother trying to read the queue yourself, just wait until some other client reads it and then your expired messages will be gone. If no one is going to read the receipts at all, why bother saving them - but as long as one client reads them, you should be good.
Back to top
View user's profile Send private message
ivanachukapawn
PostPosted: Thu Sep 14, 2006 12:51 pm    Post subject: Reply with quote

Knight

Joined: 27 Oct 2003
Posts: 561

Scott,

The core app is an ESB. It is required to publish receipts for every Business Event message passed through the bus. Clients of the ESB would dequeue the event receipts if they were properly designed. The design of the ESB client applications is beyond the political scope of the ESB development team. These facts lead to a situation in which we are publishing messages to a queue for which there are 0 consumers. Here enters this ridiculous expiry scheme. The idea is to set MQMD.expiry and then to trigger a browse program on depth.
My remaining technical challenge for this approach is related to the need to KSH parse the MQTMC2 structure to glean both queueName and qmgrName for use as parameters to amqsbcg.

jd
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Sep 14, 2006 3:13 pm    Post subject: Reply with quote

Grand High Poobah

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

ivanachukapawn wrote:
Scott,

The core app is an ESB. It is required to publish receipts for every Business Event message passed through the bus. Clients of the ESB would dequeue the event receipts if they were properly designed. The design of the ESB client applications is beyond the political scope of the ESB development team. These facts lead to a situation in which we are publishing messages to a queue for which there are 0 consumers. Here enters this ridiculous expiry scheme. The idea is to set MQMD.expiry and then to trigger a browse program on depth.
My remaining technical challenge for this approach is related to the need to KSH parse the MQTMC2 structure to glean both queueName and qmgrName for use as parameters to amqsbcg.

jd
No need if you run on Version 6 of MQ. There seems to be a part of MQ that cleans up expired messages periodically.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
ivanachukapawn
PostPosted: Fri Sep 15, 2006 3:49 am    Post subject: Reply with quote

Knight

Joined: 27 Oct 2003
Posts: 561

FJB,

That's extremely interesting (that --> a feature of MQ6 which removes expired messages from queues). I will setup a test to verify that this actually happens. In the meanwhile, could you point me to the documentation which indicates that this feature exists?

Thanks,

Ivana
Back to top
View user's profile Send private message
ivanachukapawn
PostPosted: Mon Sep 18, 2006 6:43 am    Post subject: Reply with quote

Knight

Joined: 27 Oct 2003
Posts: 561

Here is ksh code which uses patterns to parse the mqtrmc2 structure gleaning queueName and queueManagerName. The script then continues to run amqsbcg which browses the queue and removes the expired messages. Then it creates a command file and runs runmqsc to turn the trigger control back on.

Note: This turned out to be just a useless exercise because the gentlemen who posted that MQ6.0 has a feature which automatically removes expired messages IS CORRECT! MQ6.0 takes care of this problem automatically.

!/bin/ksh

##########################################################
# REMOVE THE LEADING MQTRMC2 HEADER INFO (ID and VERSION)
##########################################################

removedIDver=${1#*2}

##########################################################
# PATTERN MATCH TO YIELD queueName
##########################################################

queueName=${removedIDver%% *}

##########################################################
# PATTERN MATCH TO YIELD queueManagerName
##########################################################

queueManagerName=${removedIDver##*\&}

##########################################################
# BROWSE THE QUEUE (THIS WILL REMOVED EXPIRED MESSAGES)
##########################################################

/opt/mqm/samp/bin/amqsbcg $queueName $queueManagerName

##########################################################
# CREATE AN MQSC COMMAND FILE AND PIPE IT INTO
# RUNMQSC - THIS WILL TURN THE TRIGGER BACK ON
# (TRIGGER WAS TURNED OFF BY MQ WHEN THIS SCRIPT WAS
# TRIGGERED)
##########################################################

commandFile='mqscCommand'

echo 'ALTER QLOCAL (' $queueName ') TRIGGER' 1>$commandFile

runmqsc $queueManagerName <$commandFile
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Sep 18, 2006 3:21 pm    Post subject: Reply with quote

Grand High Poobah

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

I am a little baffled as to the why...
  1. if the queue is serviced regularly like you have a listener or a trigger at first, there should be no expired message on it as it would disappear under the get.
  2. If the queue is not serviced regularly why would you send messages with expiry to it at all?
  3. If the servicing program is down and needs fixing wouldn't you know which queue it is and could schedule a browse every so often for the estimated down time passing the qname and qmgr as parms on the command line?
  4. It seems like a big effort for little return, but then I don't know how extensive you problem is and I might be completely off base.

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
ivanachukapawn
PostPosted: Mon Sep 18, 2006 3:24 pm    Post subject: Reply with quote

Knight

Joined: 27 Oct 2003
Posts: 561

Scott,

The core app is an ESB. It is required to publish receipts for every Business Event message passed through the bus. Clients of the ESB would dequeue the event receipts if they were properly designed. The design of the ESB client applications is beyond the political scope of the ESB development team. These facts lead to a situation in which we are publishing messages to a queue for which there are 0 consumers. Here enters this ridiculous expiry scheme. The idea is to set MQMD.expiry and then to trigger a browse program on depth.
My remaining technical challenge for this approach is related to the need to KSH parse the MQTMC2 structure to glean both queueName and qmgrName for use as parameters to amqsbcg.

jd
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Sep 18, 2006 3:38 pm    Post subject: Reply with quote

Grand High Poobah

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

If they do not dequeue their receipts why subscribe them in the first place. Unsubscribe them and you won't have to deal with this problem at all.

Or allow only non durable subscriptions to the topic...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Tue Sep 19, 2006 1:59 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

FJ -
ivanachukapawn is not actually using Pub/Sub.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » DEFINE PROCESS - user data - parameter substitution
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.