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 » IBM MQ Java / JMS » Client connection from Oracle to IBM MQ is very slow

Post new topic  Reply to topic Goto page 1, 2  Next
 Client connection from Oracle to IBM MQ is very slow « View previous topic :: View next topic » 
Author Message
modulo2
PostPosted: Mon May 13, 2019 6:15 am    Post subject: Client connection from Oracle to IBM MQ is very slow Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

Dears,
I have built a connector from Oracle DB to IBM MQ. I simply use Oracle Java Stored procedure to call IBM MQ Java classes within Oracle RDBMS.

I have implemented this solution from 8 years now, and was working fine from Oracle 10g, 11g (Java 1.5, Java 1.6) to IBM MQ 7.

Now I'm doing upgrade & using Oracle 12c ( Runs internal non-IBM Java 1.8 ) and would like to connect to IBM MQ v9.0.4.

I have managed to do the connection from Oracle to IBM MQ, but it is taking very long time to create the QueueManager (Always taking 41 seconds)
Code:
MQQueueManager queueManager = new MQQueueManager( qManager, props );


The same Java code I run it from the server outside Oracle on the Linux level runs normally very fast and I'm not having any issue.

I'm connecting using Java classes not JMS and having com.ibm.mq.allclient.jar & com.ibm.mq.traceControl.jar in the classpath.

Does anyone know a solution for this, or how I can trace to know teh root cause of the issue?

I never experienced such issue while I was running Oracle 10g, 11g (Java 1.5, Java 1.6) to IBM MQ 7.

Thanks.
Back to top
View user's profile Send private message
hughson
PostPosted: Mon May 13, 2019 7:57 am    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

Could you tell us a little more about your setup please? We have very little to go on and could only really guess.

That said, my best guess on a 41 second time out for a client connect would be that you have a comma separated conname with three IP addresses, and it is timing out after 20 seconds on the first two and working on the 3rd. However, given that you have not told us about your connection name field, that could be way off base!

In short, tell us more so we can help you more.

Alternatively, take some MQ trace and look what your client connection is doing for the 41 seconds.

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
modulo2
PostPosted: Mon May 13, 2019 9:15 am    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

Actually, I wanted to cut it short as setup for making this work is long, I have detailed the connection done & working perfect from 2011 in this blog post http://ashraffouad.blogspot.com/2011/07/oracle-db-application-to-ibm-mq.html

But, let me tell you about the current setup and thanks in advance for your patience & willing to help.

I wanted to connect from Oracle PL/SQL to IBM MQ for sync/async messaging, so I built Oracle Java Stored procedure that uses IBM MQ Java classes (Oracle JVM is Java Standard Edition, and version is based on Oracle release). So of course as the Java code uses classes from MQ to connect I need to add Java Client connection jars to the path of Oracle, but Oracle requires to load the whole jars within its schema (This is the way Oracle deals with CLASSPATH https://docs.oracle.com/database/121/JJDEV/cheleven.htm ).

So, I'm loading my Java source files into Oracle DB schema + com.ibm.mq.allclient.jar & com.ibm.mq.traceControl.jar using the following command in Oracle:
Code:
%ORACLE_HOME%\dbhome_1\BIN\loadjava -user ORAMQ/ORAMQ -verbose -fileout %INSTALL_DIR%\xyz.log %INSTALL_DIR%\com.ibm.mq.allclient.jar -resolve


The above command is repeated for com.ibm.mq.traceControl.jar & my source file as well.

I start doing the test, and it works, i.e. Oracle PL/SQL stored procedure, calls my Oracle Java Stored Procedure that uses the IBM MQ libraries in connecting to IBM MQ and send the message, but it is very slow, previous releases was in milliseconds. I trace my code, and I found that 41 sec is taken in
Code:
MQQueueManager queueManager = new MQQueueManager( qManager, props );

Then remaining of code executes in no time.

I need to know why it is taking that long?

What is mainly changed in my environment is two parameters Oracle JVM from ( 1.5 or 1.6 ) that were working perfectly, changed to be Oracle JVM ( 1.8 ), also IBM MQ client from v7 to v9.0.4

I needed to upgrade IBM MQ client to v9.0.4 as it was throwing IllegalArgumentException when opening queue manager connection, and I found IBM support mentioning that I need to upgrade the MQ client to newer support https://www-01.ibm.com/support/docview.wss?uid=swg21691259

Regarding the parameters I'm sending props:
Single server IP address for the host.
IBM MQ Port
CCSID
Channel
QueueManager name or * (Actually both of them work)


Sorry for the long email, I hope this clarify the situation.

Thanks.
Back to top
View user's profile Send private message
hughson
PostPosted: Mon May 13, 2019 11:38 am    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

modulo2 wrote:
I trace my code, and I found that 41 sec is taken in
Code:
MQQueueManager queueManager = new MQQueueManager( qManager, props );

Then remaining of code executes in no time.

I don't see anything that immediately jumps out from your description. Have you tried capturing MQ trace of your client and seeing what the 41 seconds is spent doing? It may not be all that meaningful to you, but it may help some of the MQ people on here advise further.

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
modulo2
PostPosted: Tue May 14, 2019 5:11 am    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

I think MQ Trace is what I 'm searching about, I didn't try this before. I tried to implement as per this URL https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.tro.doc/q131530_.htm

by setting com.ibm.msg.client.commonservices.trace.status to ON

The problem that I'm not executing within normal JVM, its DB JVM that has special way for setting the variable as below PL/SQL code:
Code:
L_SYS_PROPERTY := DBMS_JAVA.set_property('com.ibm.msg.client.commonservices.trace.status', 'ON');


After execution I could not manage to find any file *.trc generated I don't know why?

I made another trial, by decompiling com.ibm.mq.allclient.jar and I can see everywhere
Code:
if (Trace.isOn) {
        .....
}

This could have really help.

My target is to find the java call within MQ classes that cause the issue and most propbably it should be within establishing remote connection, and check within Oracle JVM ( As it is special JVM with restricted way of development ). So, I started tracing the code on decompiled java files, but got lost after many trials of tracing by eye.

I'll try another solution by running the same code outside Oracle and check the calling sequence.

If you have any other ideas, appriciate your experience.


[/url][/b]
_________________
Thanks
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Tue May 14, 2019 3:04 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
Location: London, ON Canada

You should dump out JVM environment variables just to make sure that your settings are being pickup up.
i.e.
Code:
System.getProperties().list(System.out);


Also, maybe the UserId doesn't have permission to write in the default directory. You can set the following to specify a directory that the UserId has permission to:
Code:
com.ibm.msg.client.commonservices.trace.outputName=C:\Temp\trace.trc


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
modulo2
PostPosted: Tue May 14, 2019 10:12 pm    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

Clarify the situation:
(1) Oracle PL/SQL Procedure ---calls---> (2)Java Stored Procedure ---calls---> (3)MQ Classes for Java

On Linux level I made everyone able to write to the output log folder
Code:
chmod 777 /oramq/log


Trial one:
I added properties on (1) PL/SQL code
Code:
L_SYS_PROPERTY := DBMS_JAVA.set_property('com.ibm.msg.client.commonservices.trace.status', 'ON');
L_SYS_PROPERTY := DBMS_JAVA.set_property('com.ibm.msg.client.commonservices.trace.outputName', '/oramq/log/mqjava.trc');


I was able to retrieve above system properties in my (2)Java stored procedure and logged them ( As I made my own logger ); I was able to write on the same folder /oramq/log/logger.txt I found the owner of the file is oracle oracle but unfortuanlty I could not find /oramq/log/mqjava.trc
Code:
String mqTraceStatus = System.getProperty("com.ibm.msg.client.commonservices.trace.status");
String mqTraceOutput = System.getProperty("com.ibm.msg.client.commonservices.trace.outputName");



Trial two:
I removed adding the properties from (1) PL/SQL, and add these system properties in (2)Java Stored Procedure code just to make sure it should be set before calling (3) MQ Classes for Java
Code:
System.setProperty("com.ibm.msg.client.commonservices.trace.status", "ON");
System.setProperty("com.ibm.msg.client.commonservices.trace.outputName", "/oramq/log/mqjava_custom.trc");

My (2) Java Stored Procedure was able to log to folder ( The owner of the file is oracle oracle ) but also I could not get trace file of /oramq/log/mqjava.trc

It is very strange as all (1) PL/SQL Code, (2) Java Stored Procedure, (3) MQ Classes for Java should be running within the same Java session.

Very strange, I will check how decompiled MQ Classes for Java are writing to file, maybe will lead to something.

Appreciate any ideas

_________________
Thanks
Back to top
View user's profile Send private message
modulo2
PostPosted: Wed May 15, 2019 1:50 am    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

I checked the decompiled code, and found that MQ trace is based on java.util.logging.*

I wonder why it is not working?
_________________
Thanks
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed May 15, 2019 12:15 pm    Post subject: Reply with quote

Grand High Poobah

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

I can think off the bat about one big change between your MQ versions.
At MQ Version V7 there is no password checking done with the OS. At MQ Version 9 the password is being checked with the OS by the server. This may have some latency built in if you are going against a busy LDAP.

I assume here that you are doing a client connection over the network. You should probably look at caching the connection to MQ so that the penalty of the connection is only incurred once.
Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
modulo2
PostPosted: Wed May 15, 2019 12:41 pm    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

Thanks for suggestion, but the same code executes from thd DB server but from the Linux OS normal jvm in < 1 sec, i use the same java used by Oracle v1.8

But do you think, i should try IBM MQ client earlier like IBM MQ v8?
_________________
Thanks
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed May 15, 2019 9:53 pm    Post subject: Reply with quote

Grand High Poobah

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

modulo2 wrote:
Thanks for suggestion, but the same code executes from thd DB server but from the Linux OS normal jvm in < 1 sec, i use the same java used by Oracle v1.8

But do you think, i should try IBM MQ client earlier like IBM MQ v8?

Don't do that. the difference is the MQ Server you are connecting to. If the MQ Server is version 8 or above it is checking the userid/password of your connection. You may not have to pass a password depending on the settings in the AUTHINFO setup. But if you do, it needs to match the os password and will get checked. Depending on your MQ system load and login checking load that might take a little while. Hence the suggestion of using a connection pool.

Hope it helps
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
modulo2
PostPosted: Sun May 19, 2019 6:10 am    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

I have checked with MQ Admin and we are not checking the username / password of connection.
_________________
Thanks
Back to top
View user's profile Send private message
modulo2
PostPosted: Sun May 19, 2019 11:08 pm    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

I have tried with client library for IBM MQ v8.0.0.9 and it took 21 sec to connect !!!

I don't know what's happening.

I think without MQ trace I'm running blindly
_________________
Thanks
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon May 20, 2019 6:37 am    Post subject: Reply with quote

Grand High Poobah

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

Is Reverse DNS turned on? what is the output of

Code:
echo dis qmgr revdns | runmqsc <qmname>

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
modulo2
PostPosted: Mon May 20, 2019 11:24 pm    Post subject: Reply with quote

Novice

Joined: 05 May 2007
Posts: 18

It is enabled.

Code:
echo dis qmgr revdns | runmqsc BBHUBLX02D
5724-H72 (C) Copyright IBM Corp. 1994, 2016.
Starting MQSC for queue manager BBHUBLX02D.


     1 : dis qmgr revdns
AMQ8408: Display Queue Manager details.
   QMNAME(BBHUBLX02D)                      REVDNS(ENABLED)
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.

_________________
Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » Client connection from Oracle to IBM MQ is very slow
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.