Author |
Message
|
mqhelpless |
Posted: Fri Sep 08, 2006 9:19 pm Post subject: Configure API Exit |
|
|
Apprentice
Joined: 13 Jul 2005 Posts: 33
|
I am trying to configure the sample api exit program (amqsaxe.dll) on windows platform, running MQ v6. I've followed the list of instruction as stated :
ApiExitLocal: Sequence=100
Function=EntryPoint
Module=C:\applfolder\amqsaxe.dll
Name=SampleApiExit
and the environment variables as follows :
SET MQAPI_TRACE_LOGFILE=C:\temp\ApiTrace.
Once I'm done with my configuration, I stop/start my QManager. However, I am still not able to generate the trace log. There's no error or anything. Have I missed out on any step? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Sep 09, 2006 3:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Does the userId running the qmgr have authority to write to c:\temp? _________________ MQ & Broker admin |
|
Back to top |
|
 |
wschutz |
Posted: Sat Sep 09, 2006 3:31 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
I haven't done it in windows (it does work in linux)....where did you SET MQAPI_TRACE_LOGFILE? I would think it needs to be a system evnironment variable and you probably should re-boot the whole machine....
Also, the default trace level isn't very interesting, you might want to set MQAPI_TRACE_OPTIONS (or put a value in ExitData).... _________________ -wayne |
|
Back to top |
|
 |
mqhelpless |
Posted: Sun Sep 10, 2006 3:37 am Post subject: API Exit - MQPUT Before How to get Queue |
|
|
Apprentice
Joined: 13 Jul 2005 Posts: 33
|
Thanks for the feedback. I managed to resolve the issue after rebooting the machine ... found that restarting the Qmanager or for this matter the services doesn't help.
Also, I hope you guys can help me with the following issue:
I want to create the API exit such that for messages bound for a particular queue, I want to inspect its content. If it is of a particular topic, I will allow the message to be put into the remote queue. If not, I want to drop it into a temp queue. What I need to know is if I do a PutBefore (i.e. before putting the message into remote queue, API exit is invoked), is it possible for me to know which remote queue it is trying to access? If I do not know this information, I will not be able to determine if the correct subject id is going into the correct remote queue. Thanks. |
|
Back to top |
|
 |
Nigelg |
Posted: Mon Sep 11, 2006 12:35 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
You cannot do that in a PutBefore, since the name of he queue is not known at that time.
You could keep a list of object descriptors associated with queue names, and add queues to the list at MQOPEN and remove them at MQCLOSE, then check your list against the OD passed in to the MQPUT. _________________ MQSeries.net helps those who help themselves.. |
|
Back to top |
|
 |
mqhelpless |
Posted: Wed Sep 13, 2006 6:14 am Post subject: |
|
|
Apprentice
Joined: 13 Jul 2005 Posts: 33
|
thanks for the suggestion. i have another question. say at MQPUT Before, I inspect the content (say Topic ID) of the message and check against a list of valid topic (in dbase or flat file) and found that this particular Topic ID is not meant for this particular queue. I want to then drop the message into a local-queue say 'DLQ'. How can I achieve this change of destination queue a MQPUT Before? |
|
Back to top |
|
 |
Nigelg |
Posted: Wed Sep 13, 2006 6:52 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
The hConn, i.e. the connection to the qmgr, is available in an API exit so you can open a queue and put your msg to it with MQOPEN/MQPUT/MQCLOSE, or MQPUT1 might be better.
Then you can fail the Put Before with whatever error you think is most appropriate, e.g. CompCode 2, ReasonCode MQRC_API_EXIT_ERROR, so the msg is not put to the original queue.
THis is just theory; I have not tried it.
Have a go, and report back... _________________ MQSeries.net helps those who help themselves.. |
|
Back to top |
|
 |
|