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 » General Discussion » Do API exits work with Java applications?

Post new topic  Reply to topic
 Do API exits work with Java applications? « View previous topic :: View next topic » 
Author Message
yashgt
PostPosted: Mon Apr 03, 2017 4:16 am    Post subject: Do API exits work with Java applications? Reply with quote

Apprentice

Joined: 11 Nov 2014
Posts: 38

I am following the documentation at https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q027980_.htm

The API exit I have created works fine when the application that invoke the API is in C/C++. The Get_After hook of the API exit gets called correctly.

But when I use a Java application against the same Queue Manager, the hook does not get called.

What might be the reason?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Apr 03, 2017 4:49 am    Post subject: Re: Do API exits work with Java applications? Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

yashgt wrote:
I am following the documentation at https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q027980_.htm

The API exit I have created works fine when the application that invoke the API is in C/C++. The Get_After hook of the API exit gets called correctly.

But when I use a Java application against the same Queue Manager, the hook does not get called.

What might be the reason?

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
View user's profile Send private message Send e-mail
yashgt
PostPosted: Mon Apr 03, 2017 4:58 am    Post subject: Reply with quote

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
View user's profile Send private message
markt
PostPosted: Mon Apr 03, 2017 5:11 am    Post subject: Reply with quote

Knight

Joined: 14 May 2002
Posts: 502

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
View user's profile Send private message
zpat
PostPosted: Mon Apr 03, 2017 5:15 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
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
View user's profile Send private message
yashgt
PostPosted: Mon Apr 03, 2017 5:28 am    Post subject: Reply with quote

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
View user's profile Send private message
steve29031995
PostPosted: Wed Jun 27, 2018 10:41 am    Post subject: Java Exit Code Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Jun 27, 2018 8:34 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
hughson
PostPosted: Wed Jun 27, 2018 9:43 pm    Post subject: Re: Do API exits work with Java applications? Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
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
View user's profile Send private message Visit poster's website
RogerLacroix
PostPosted: Fri Jun 29, 2018 9:42 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Do API exits work with Java applications?
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.