Author |
Message
|
SixBlade |
Posted: Tue Dec 06, 2005 7:41 am Post subject: JMS & BlockIP2 |
|
|
Apprentice
Joined: 03 Dec 2003 Posts: 26 Location: UK
|
Hi,
I'm currently facing a problem with BlockIP2. I basically need to figure out how to, from the MQ JMS api, set the correct user id, the one that will show in a server side security exit as PMQCD.RemoteUserIdentifier. For Base MQ classes, this is MQEnvironment.userID according to docs and my test, but I have to use JMS classes, and I cannot find the correct approach. Anyone who has done this or have managed to find docs for it etc? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Dec 06, 2005 7:57 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The JMS send method sets the user ID.
There's a lot of topics about JMS and user ID's here. A quick review would probably be very helpful to you. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
SixBlade |
Posted: Tue Dec 06, 2005 8:12 am Post subject: |
|
|
Apprentice
Joined: 03 Dec 2003 Posts: 26 Location: UK
|
Sorry for the very unclear problem description: it is during connect I get problems, since the user id isn't supplied according to MQ. I don't get as far as "put" in other words. For this specific topic I haven't been able to google or search here either. Anyway, just happened to find the solution. For the JMS classes, you can still use MQEnvironment.userID, if you're using the version 5.3 classes (at least 5.3 and csd 9). But in version 6, it won't work (as far as I remember, there is a new sec structure for version 6 instead). |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Dec 06, 2005 8:14 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
How are you creating your queue connection factory? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
SixBlade |
Posted: Tue Dec 06, 2005 8:23 am Post subject: |
|
|
Apprentice
Joined: 03 Dec 2003 Posts: 26 Location: UK
|
Don't know if this question still needs an answer, but this is basically what I set on the conn factory:
Code: |
myQueueConnectionFactory.setHostName( host );
myQueueConnectionFactory.setPort( port );
myQueueConnectionFactory.setChannel( channel );
myQueueConnectionFactory.setQueueManager( qmgrName );
MQEnvironment.userID = userId;
|
|
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Dec 06, 2005 9:28 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
SixBlade wrote: |
Don't know if this question still needs an answer, but this is basically what I set on the conn factory:
Code: |
myQueueConnectionFactory.setHostName( host );
myQueueConnectionFactory.setPort( port );
myQueueConnectionFactory.setChannel( channel );
myQueueConnectionFactory.setQueueManager( qmgrName );
MQEnvironment.userID = userId;
|
|
You are mixing JMS and base java.
To set the user id in JMS you open the connection passing the userid and passwd:
Code: |
QueueConnection con=myQueueConnectionFactory.createQueueConnection(userid, passwd); |
Remember that depending on the version / security exit the passwd might not get checked but the user certainly does if not blank.
Enjoy  |
|
Back to top |
|
 |
SixBlade |
Posted: Wed Dec 07, 2005 1:02 am Post subject: |
|
|
Apprentice
Joined: 03 Dec 2003 Posts: 26 Location: UK
|
Thanks, that's the piece of code I didn't manage to find in the manuals for some reason. Know I was mixing JMS and base java api, it happened to work but didn't feel great so to speak. May I ask where you found that piece of information...? Java JMS spec, MQ using java guide, security guide....?
Thanks anyway! |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Dec 07, 2005 11:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
MQ Using Java guide & JMS spec
 |
|
Back to top |
|
 |
|