Author |
Message
|
zen |
Posted: Wed May 11, 2005 6:11 am Post subject: MQ Connection Pool |
|
|
Apprentice
Joined: 11 May 2005 Posts: 32 Location: Singapore
|
Hi, help needed badly. The situation is this:
We have an application that creates a connection pool w/c is deployed on the server. Apps developers connect to this pool for their MQ connection needs. However, since many of the developers connect to the pool at same times, the limited allowed pool is almost always on the max. Now, we are looking at creating a Java application or program to create a connection pool on the client/local machines. The application will be deployed on each local machines of our developers.
My question is, is this possible? What will be a better flow? Will I create a connection pool on the local machine and talk directly to our mainframe, if possible? Or is it better to create a connection pool on the local machine and communicate with the server's MQ manager to connect to our mainframe, if possible? Or if you have any other ideas, that would be of much help.
Fortunately, I was the one assigned to research and develop on this, because I always wanted to learn new things since this is my first time to work on MQ. I am just a newbie programmer by the way.
Thank you so much in advance and hoping for your replies. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed May 11, 2005 6:19 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Just use JMS.
Or just use the WebSphere MQ API for Java.
If I understand your current design, you've gone to a lot of trouble to create a "standard interface to MQ", when IBM already supplies you TWO standard interfaces to MQ - one that is actually the J2EE standard interface (JMS) and one that is the IBM standard.
And the first rule of connection pools is - if they are always full, make them bigger. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
zen |
Posted: Wed May 11, 2005 6:02 pm Post subject: |
|
|
Apprentice
Joined: 11 May 2005 Posts: 32 Location: Singapore
|
Hi, thanks a lot for your reply. Can you give me a quick detail or summary on how to use this JMS? Do I need to install MQ on the local machine for this? Also, if you have any link on using this JMS would be hugely appreciated.
Again, thanks a lot.
Zen |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu May 12, 2005 3:22 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can find all the information you want about JMS at http://java.sun.com. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu May 12, 2005 12:36 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
and read from the documentation button:
MQ -- Using Java.
It will explain the way to use JMS with the MQ provider...
Enjoy  |
|
Back to top |
|
 |
zen |
Posted: Tue May 17, 2005 6:02 pm Post subject: MQ Connection Pool |
|
|
Apprentice
Joined: 11 May 2005 Posts: 32 Location: Singapore
|
Hi, thanks a lot for your replies. I read the documentation plus the postings on this forum and I was able to make the client application connect to the mq server and create a local connection pool. At the first cut, we didn't implement any form of security over the connection and the client application works just fine. However, when we tried to authenticate the user using the userid, we get the error below:
SystemErr R MQJE001: An MQException occurred: Completion Code 2, Reason 2035
MQJE036: Queue manager rejected connection attempt
MQJE001: An MQException occurred: Completion Code 2, Reason 2035
MQJE036: Queue manager rejected connection attempt
I already searched all the forums regarding this exception and I've tried a lot of the suggestions and solutions presented. Unfortunately, to no avail I cannot make this work.
We already placed the userid usr001 in the mqm group and below is the dspmqaut results of usr001:
dspmqaut -m MQTEST -t qmgr -p usr001
Entity usr001 has the following authorizations for object MQTEST:
inq
set
connect
altusr
crt
dlt
chg
dsp
setid
setall
Meanwhile on the client, we have a ClientConnectionManager class with the code snippets below:
[more codes]
.........
.......
MQEnvironment.channel = "MQTEST.SVRCONN";
MQEnvironment.hostname = "testserv003";
MQEnvironment.port = 1414;
MQEnvironment.userID = "usr001";
......
.....
....
[more codes]
......
.....
MQSimpleConnectionManager conman = new MQSimpleConnectionManager();
conman.setActive (MQSimpleConnectionManager.MODE_ACTIVE);
conman.setTimeout (20000);
....
....
[more codes]
.....
MQQueueManager qMgr = new MQQueueManager("MQTEST", conman);
ClientConnectionManager.freeConnection (qMgr);
.....
......
Any insights or suggestions will be greatly appreciated. More power guys. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 17, 2005 6:19 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
For it to work.
A) remove your client userid from the mqm group.
b) create a group like myapp and add your user usr001 to it.
c) grant rights to the queue, and the qmgr (connect at minimum) for your group myapp.
Remember max userid length is 12
and if the userid running the program is not the one you are passing forget about bindings mode cause it will only work in client mode.
Last but not least check out BlockIP2 to close the security hole.
Enjoy  |
|
Back to top |
|
 |
zen |
Posted: Tue May 17, 2005 6:44 pm Post subject: MQ Connection Pool |
|
|
Apprentice
Joined: 11 May 2005 Posts: 32 Location: Singapore
|
Hi, thanks for your reply. Before I try to do that, may I ask what's the diff bet. adding the userid in the mqm group with creating a new group and adding the userid in that new group? Also, in my client code, do I still have to specify the userid (i.e. MQEnvironment.userID = "usr001" ? Lastly, does the server user id has to be the same as the userid used to login to the client machine or it can be different as long as the MQEnvironment.userid is set to the same userid enrolled in the server, i.e.:
client login userid: workstation01
server userid: usr001
MQEnvironment.userID = usr001
Thanks a lot. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Tue May 17, 2005 6:45 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
If the QM is on Windows, look in Event Viwer or in the AMQERR log after your app gets a 2035. There you will find exactly what ID the QM is using to determine if you have access. If its not Windows, you can turn Authority Events on for the QM, and then look in the SYSTEM.ADMIN.QMGR.EVENT to see what ID is being used.
I can tell you this, if you added usr001 to the mqm group, and your dspmqaut command shows all those authorities, and you are failing with a 2035 on the connect, then you are NOT using that ID to try and connect to the QM.
fjb_saper comments about getting your ID out of the mqm group and into your own group are valid, but will not solve your problem if you can't connect while it is in the mqm group to begin with, since the mqm group has super authority. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 17, 2005 6:52 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Let's remember as well that whatever the userid
you can still get a 2035 in following situation:
Transport = mqbindings
user running your program = myuser
user passed by your program(MQ.Environment) = usr001.
Does not matter if usr001 is in the mqm group or not.
In bindings the authority of the usr running the process is checked and if you are trying to pass a different user you are being shot down!!
Enjoy  |
|
Back to top |
|
 |
zen |
Posted: Tue May 17, 2005 6:55 pm Post subject: MQ Connection Pool |
|
|
Apprentice
Joined: 11 May 2005 Posts: 32 Location: Singapore
|
Hi,
Thank you very much for your reply. The QM is in a Linux machine. I haven't looked at the error logs because I don't have administration permission on our server. But since you pointed that out, I will ask for admin's assistance to look at the error logs in QM server and hopefully I could find and resolve the problem from there. I will let you know the results.
Thanks a lot.
Ü |
|
Back to top |
|
 |
zen |
Posted: Tue May 17, 2005 7:01 pm Post subject: MQ Connection Pool |
|
|
Apprentice
Joined: 11 May 2005 Posts: 32 Location: Singapore
|
Hi fjb_saper,
I believed that my client connection to the QM is TCP/IP client connection and not in a bindings mode since in client my code I set the MQEnvironment variables and based on what I read on the documentations. Am I correct with my belief? How can one tell if the connection is bindings or not? I believe my full understanding of this is essential.
Thanks. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 17, 2005 7:28 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
check MQEnvironment.Transport
 |
|
Back to top |
|
 |
zen |
Posted: Tue May 17, 2005 7:54 pm Post subject: |
|
|
Apprentice
Joined: 11 May 2005 Posts: 32 Location: Singapore
|
Hi fjp_saber, did you mean i'll put MQEnvironment.Transport in my client java code? My java compiler complains that MQEnvironment.Transport is not a valid method. How can I display this? |
|
Back to top |
|
 |
zen |
Posted: Tue May 17, 2005 7:58 pm Post subject: |
|
|
Apprentice
Joined: 11 May 2005 Posts: 32 Location: Singapore
|
PeterPotkay, our QM is installed in a linux machine. How do I turn on the Authority Events for the QM, and how do I display the SYSTEM.ADMIN.QMGR.EVENT? I'm just new to using MQ and having hard time looking at the logs and events. It's not as easy as viewing a plain text file.
Thanks. |
|
Back to top |
|
 |
|