|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Distributed API exit and callbacks |
« View previous topic :: View next topic » |
Author |
Message
|
tczielke |
Posted: Mon Mar 16, 2015 4:44 am Post subject: Distributed API exit and callbacks |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
I ran across something odd when using the sample amqsaxe0 API exit and the amqscbf sample for MQCB, and was wondering if anyone had any more insight into this topic.
On Linux, I set up the amqsaxe0 API exit and ran the amqscbf program with the amqsaxe0 exit active. I was expecting to see two ApiTrace datasets:
ex:
ApiTrace.26757.1.log
ApiTrace.26757.2.log
However, only one was generated for thread 1:
ApiTrace.26757.1.log
When I looked inside the ApiTrace.26757.1.log file, it contained the "MQ Callback" entries, which I was expecting to see on a thread 2 ApiTrace file. I also had run a strmqtrc when I ran the amqscbf program, and in that trace you do see the MQGETs for the call back running on thread 2.
Does anyone know why this amqsaxe0 exit would record the MQGETs that thread 2 was doing under the thread 1 file? Is this expected behavior, and am I just wrong in what I was expecting to see with the API exit output for the amqscbf program? _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Mon Mar 16, 2015 3:23 pm Post subject: Re: Distributed API exit and callbacks |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
tczielke wrote: |
I ran across something odd when using the sample amqsaxe0 API exit and the amqscbf sample for MQCB, and was wondering if anyone had any more insight into this topic. |
It is because the thread is using the same connection handle. i.e. The EntryPoint of the API Exit is only invoked once.
On the other hand, if you used your 'amqscnxc_thread' program, each thread will issue its own MQCONN and then the EntryPoint of the API Exit will be executed.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
tczielke |
Posted: Mon Mar 16, 2015 6:45 pm Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
Thanks for the clarification. I think I need to look more deeper into this.
I tried using a multi-threaded C sample that does an MQCONN and then creates two threads and shares the same connection between the two threads, and I do see this similar behavior. Both threads 2 and 3 write out to the ApiTrace 1 log file.
When I adjust the multi-threaded C sample so that it first creates two separate connections on the original thread 1 (with the MQCNO_HANDLE_SHARE_BLOCK option), I see that the ApiExit Log 1 file gets created once, and then blitzed and recreated again, for each MQCONNX call. This leaves one of the MQCONNX calls completely missing from the ApiTrace 1 log file.
It is more clear now what is happening. However, this behavior won't work with how I intended to use this exit. Like I said, I need to research this more. Thanks. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
tczielke |
Posted: Tue Mar 17, 2015 5:49 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
One note:
If you set the MQAPI_TRACE_OPTIONS=2 for amqsaxe0 and run the amqscfb sample, it looks like the pExitContext->ThreadId is incorrectly being reported as 1 on the separate callback thread, when it should be something like 2. amqsaxe0 doesn't really use the pExitContext->ThreadId, besides to set up the name of the ApiTrace log file on the EntryPoint (Initialisation) function. So this bug is not really exposed in the sample amqsaxe0 exit. However this bug is something be aware of, if you are using API exits and are using that pExitContext->ThreadId that gets passed into the API functions (i.e. GetBefore, GetAfter, etc.). At least that is what I am observing. _________________ Working with MQ since 2010. |
|
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
|
|
|
|