Author |
Message
|
yashgt |
Posted: Mon Apr 03, 2017 4:16 am Post subject: Do API exits work with Java applications? |
|
|
Apprentice
Joined: 11 Nov 2014 Posts: 38
|
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Apr 03, 2017 4:49 am Post subject: Re: Do API exits work with Java applications? |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You might need to write the exit in Java, or make sure of the following:
Load the corresponding exit library in Java, and make sure the exit stubs are loaded correctly (look at the mqibind and mqexitstub02 libraries in the <mqinstall>/java/lib and <mqinstall>/java/lib64 directories... )  _________________ MQ & Broker admin |
|
Back to top |
|
 |
yashgt |
Posted: Mon Apr 03, 2017 4:58 am Post subject: |
|
|
Apprentice
Joined: 11 Nov 2014 Posts: 38
|
There is no documentation for writing User API exits in Java. If someone can point me to the right documentation, that will be helpful. |
|
Back to top |
|
 |
markt |
Posted: Mon Apr 03, 2017 5:11 am Post subject: |
|
|
 Knight
Joined: 14 May 2002 Posts: 508
|
You can't write API exits in Java.
If using local bindings to the qmgr, then the C API exit will be loaded inside the process.
If using client connections, then you can have the API exit run inside the svrconn channel process, but not locally in the Java program. |
|
Back to top |
|
 |
zpat |
Posted: Mon Apr 03, 2017 5:15 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
I think the question was more - why do Java apps not invoke the exit? _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
yashgt |
Posted: Mon Apr 03, 2017 5:28 am Post subject: |
|
|
Apprentice
Joined: 11 Nov 2014 Posts: 38
|
The Java program uses local bindings. Will the API exit written in C run in the process space of the Java application? |
|
Back to top |
|
 |
steve29031995 |
Posted: Wed Jun 27, 2018 10:41 am Post subject: Java Exit Code |
|
|
Newbie
Joined: 27 Jun 2018 Posts: 1
|
API exit will not run in Java. You can rather use System exit command to close the virtual machine.
System.exit() in Java this will shut down the Java Virtual machine.
If you still need any help you can visit https://microsoftsupport.co/microsoft-support-uk |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 27, 2018 8:34 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
zpat wrote: |
I think the question was more - why do Java apps not invoke the exit? |
And the response to that question is because it is a server side exit.
Exits that can run in Java are the security exits (client side part) and / or the message exits... or channel exits (client part).
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
hughson |
Posted: Wed Jun 27, 2018 9:43 pm Post subject: Re: Do API exits work with Java applications? |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
yashgt wrote: |
But when I use a Java application against the same Queue Manager, the hook does not get called.
What might be the reason? |
I could be that the Java application is not calling MQGET. Perhaps it is using MQCB instead.
Try running Application Activity Trace to see EXACTLY what MQ API calls the Java API you are using is translated into.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
RogerLacroix |
Posted: Fri Jun 29, 2018 9:42 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
yashgt, follow what Mark said:
markt wrote: |
You can't write API exits in Java.
If using local bindings to the qmgr, then the C API exit will be loaded inside the process.
If using client connections, then you can have the API exit run inside the svrconn channel process, but not locally in the Java program. |
Also, there is a difference between Java (POJO) and Java/JMS applications. This information is important. Plain Java applications cannot do MQCALLBACKs (which sucks) whereas Java/JMS can.
If your application is JMS then it is probably doing MQCALLBACKs rather than MQGETs which means you need to hook to the MQCALLBACK (and you probably want to hook to MQCB to see what its doing).
Finally, why are you spending hours and hours creating an MQ API to trace MQ when there is MQ Auditor which does it all at a super cheap price?
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
|