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 » User Exits » Distributed API exit and callbacks

Post new topic  Reply to topic
 Distributed API exit and callbacks « View previous topic :: View next topic » 
Author Message
tczielke
PostPosted: Mon Mar 16, 2015 4:44 am    Post subject: Distributed API exit and callbacks Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
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
View user's profile Send private message
RogerLacroix
PostPosted: Mon Mar 16, 2015 3:23 pm    Post subject: Re: Distributed API exit and callbacks Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
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
View user's profile Send private message Visit poster's website
tczielke
PostPosted: Mon Mar 16, 2015 6:45 pm    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
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
View user's profile Send private message
tczielke
PostPosted: Tue Mar 17, 2015 5:49 am    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » User Exits » Distributed API exit and callbacks
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.