|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
CLUSSDR only calls message exit once, then stops. |
« View previous topic :: View next topic » |
Author |
Message
|
coreyb |
Posted: Tue Jul 27, 2004 7:02 pm Post subject: CLUSSDR only calls message exit once, then stops. |
|
|
Newbie
Joined: 27 Jul 2004 Posts: 3 Location: Sydney, Australia
|
Hi!
I've got a message exit that logs off message details (time, MD fields, size) to a log file and want to get it working for cluster sender channels. The exit works fine on normal channels, and is working in our production environment with a fair load already.
If I define the message exit either in the CLUSRCVR definition, or by using another Channel Auto Definition exit to change the CLUSSDR the exit fails. It is called 3 times, once with MQXR_INIT, once with MQXR_MSG (which logs the first message away as expected) and then with MQXR_TERM. The problem is the second or subsequent messages don't seem to do anything. The message exit never gets called (In debug mode it logs to a separate file what it's doing, and the first thing it does is write that it’s been called) and the message never gets transported. The channel still shows in "Running" state but no messages pass through it. It times out (I set it to 60 seconds) and I restart it, then once again 1 message is transported (and logged) but nothing else goes through. The exit logs the message and shows that the MD time is 5 seconds after the first message, but wasn’t logged until ~2 minutes after the 1st message because I had to manually restart the channel. If I put a 3rd message after the channel times out rather than restarting the channel by hand, it'll fire off the 2nd message I put just after the first, log it and leave the 3rd message waiting to be transmitted. Seems the channel triggering is still working, just the channel getting messages off the queue seems to no longer work.
I’ve written a dummy exit that just logs that it’s been called, and sets the ExitResponse to MQXCC_OK, which the real exit is also doing the 3 times it does get called… this seems to work fine and multiple message pass through it.
Is there something different that I need to do to cater for cluster senders that I'm missing? I'm not getting any errors logged to either MQ error or Windows Event Log, although the same effect can be seen under AIX which I'm also testing this on. Could I be doing something in the exit that I shouldn’t be? In which case what? Basically I just build up a string with all the data I wish to log, and then call a procedure to write it to file (a separate thread under AIX, but non-threaded on windows) I can post the code if anyone needs a closer look to see if I’m doing something obviously silly.
Regards,
Corey |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jul 28, 2004 4:32 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If the dummy version works fine and the real version doesn't, then it's almost definitely a problem with your code. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
coreyb |
Posted: Wed Jul 28, 2004 8:08 pm Post subject: |
|
|
Newbie
Joined: 27 Jul 2004 Posts: 3 Location: Sydney, Australia
|
Yes, it was a problem with my code (as I suspected), strtok is not a very safe operation to call on MQ objects. Basically I was trimming spaces from the Queue Manager field of the Channel Definition and strtok will actually change the data. Simple fix was to copy the Channel Definition into a temporary variable and then process that rather than the real data.
So what was:
strcat(msgbuf,strtok(pChannelDefinition->QueueManager," "));
became:
memcpy(tmpChannelDefinition,pChannelDefinition,sizeof(pChannelDefinition));
strcat(msgbuf,strtok(tmpChannelDefinition->QueueManager," "));
for good measure I made sure I did the same thing for MD fields as well... so I only ever "play" with copies not the original data.
Still, strange that I don't get anything from MQ complaining about the new incorrect Channel Definition when the next message tries to be processed.
Regards,
Corey |
|
Back to top |
|
 |
gunter |
Posted: Wed Jul 28, 2004 11:46 pm Post subject: |
|
|
Partisan
Joined: 21 Jan 2004 Posts: 307 Location: Germany, Frankfurt
|
Maybe it's easier to use mqTrim. I don't know why IBM put it in the MQAI library and not in the MQI, these functions are also useful without using MQAI. _________________ Gunter Jeschawitz
IBM Certified System Administrator - Websphere MQ, 5.3 |
|
Back to top |
|
 |
MB |
Posted: Fri Jul 30, 2004 12:40 pm Post subject: |
|
|
Acolyte
Joined: 25 Jun 2004 Posts: 52
|
Hi,
I am working on similar Channel Message Exits and an Auto Definition Exit. I did not understand the behaviour of the Auto Definition Exit.
1. I altered the QM to have Auto Def Exit, right after creating it. Now, I try to join this QM in a cluster. When I define a cluster sender channel from this QM to Repository QM, the channel status remains in 'Binding' State. (Under same conditions, the channels start when I create the QM without Auto Def Exit). Does the QM try to invoke Auto Def Exit even for manually created channels?
2. Intercommunication Guide says:
"The channel auto-definition exit can also be called when a request is received to start a cluster-sender channel. It can be called for cluster-sender and cluster-receiver channels to allow definition modification for this instance of the channel."
I am trying for such an Auto Definition Exit that has to be invoked on every start of an 'AUTO DEFINED CLUSTER SENDER CHANNEL'.
In other words, Whenever I Stop, Alter and Start a Cluster Receiver Channel, the corresponding 'AUTO DEFINED CLUSTER SENDER CHANNEL' on the other QMs should invoke this Auto Def Exit.
Is there a way to do this?
Thanks and Regards,
MB |
|
Back to top |
|
 |
oz1ccg |
Posted: Sun Aug 01, 2004 5:42 am Post subject: |
|
|
 Yatiri
Joined: 10 Feb 2002 Posts: 628 Location: Denmark
|
Yes, and no....
the CHAD exit is invoked on non-repos qmgrs, even if you have defined the channel, this is because of the way how the cluster joining procedure works.
You qmgr uses the CLUSSDR only to establish the initial connection, and as the very first receives information about the REPOS qmgrs, incl. the CLUSRCVR of those, and thereafter will your qmgr use the received definition... This might cause problems if you use different security exits on the full-repos qmgrs and the partial repos qmgrs..... This is why the CHAD works in this manor.
I guess that you locate the information in the CLUSTER manual.
Just my $0.02  _________________ Regards, Jørgen
Home of BlockIP2, the last free MQ Security exit ver. 3.00
Cert. on WMQ, WBIMB, SWIFT. |
|
Back to top |
|
 |
MB |
Posted: Mon Aug 02, 2004 7:31 am Post subject: |
|
|
Acolyte
Joined: 25 Jun 2004 Posts: 52
|
Hi,
Thanks for the Response.
With my Auto Definition Exit, the channel is remaining in 'Binding' State. I am working on Windows currently. I have put a very basic code (just to open a file in C:\ and print 'Entered the exit') but still the channel remains in 'Binding' state.
Does anyone have a clue of why this happens?
There is no log in the Event Viewer.
The log file in errors folder of the QM has an entry as follows:
"
08/02/2004 09:59:09
AMQ9420: No repositories for cluster ADCL.
EXPLANATION:
The queue manager has received information about a cluster for which no
repositories are known.
ACTION:
Alter the REPOS or REPOSNL attribute of the queue manager, that is to have a
full repository for the cluster, to specify the cluster name.
"
But I have defined a proper cluster with appropriate REPOS QMs. (I successfully tested this cluster before modifying any QM for 'Auto Def Exit'.)
How is this error relavent to Auto Definition Exit? |
|
Back to top |
|
 |
oz1ccg |
Posted: Mon Aug 02, 2004 10:55 am Post subject: |
|
|
 Yatiri
Joined: 10 Feb 2002 Posts: 628 Location: Denmark
|
You created the cluster as documented in cluser manual ?
it seems to me that the queuemanager can't find the repos qmgr that hosts cluster=ADCL.
Try using runmqsc, and issue the commands:
DISPLAY QMGR
DISPLAY CLUSQMGR(*)
and let us see the output here.
You didn't use the Explorer under windows, right ...
This tool makes some foolish mistakes sometimes..... And the cluster might work or not work.
The only foolprof way I know is using a SCRIPT file, and follow the path in manual for creating a cluster.
Just my $0.02  _________________ Regards, Jørgen
Home of BlockIP2, the last free MQ Security exit ver. 3.00
Cert. on WMQ, WBIMB, SWIFT. |
|
Back to top |
|
 |
MB |
Posted: Mon Aug 02, 2004 11:24 am Post subject: |
|
|
Acolyte
Joined: 25 Jun 2004 Posts: 52
|
Hi,
I created the cluster using runmqsc commands. And without the Auto Def Exit on the QMs,
DIS clusqmgr(*) cluster(ADCL)
showed all the relevant QMs in the cluster.
I tested the cluster environment by sending messages from one QM to another QM (using amqsput on Local Queues shared in the cluster)
When does a channel go to Binding state?
What can I do to rectify this?
Thanks for the response,
Regards,
MB |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|