|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Specifying connection username with JMSAdmin |
« View previous topic :: View next topic » |
Author |
Message
|
kolthorr |
Posted: Fri May 20, 2005 8:17 am Post subject: Specifying connection username with JMSAdmin |
|
|
Apprentice
Joined: 09 Mar 2002 Posts: 31
|
Hi all,
We're experimenting with using WSMQ as a JMS provider to JBoss, via a client connection. We've used JMSAdmin to create a FS context, with the appropriate settings - channel, port, host etc. But there doesn't seem to be a field in JMSADmin to set the userid (that is sent to the channel agent). So I've got a security exit to map an empty userid to a valid one. This works but 'feels' somewhat suboptimal. Is it just a quirk I'll have to live with in this situation?
I know I know, we should be running local qmgrs
Thanks,
Andrew |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri May 20, 2005 11:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Read your JMS manual:
qcon = qcf.createConnection(userid, pwd);
You could also use JAAS
Enjoy  |
|
Back to top |
|
 |
kolthorr |
Posted: Mon May 23, 2005 2:46 am Post subject: |
|
|
Apprentice
Joined: 09 Mar 2002 Posts: 31
|
Thanks for the reply. If only it were that simple! The catch is that by configuring WSMQ as a 'fully native' provider, we can specify MDBs/DLQ options etc administatively in the various deployment descriptors:
Code: |
<MDBConfig>
<ReconnectIntervalSec>10</ReconnectIntervalSec>
<DLQConfig>
<DestinationQueue>queue/DLQ</DestinationQueue>
<MaxTimesRedelivered>10</MaxTimesRedelivered>
<TimeToLive>0</TimeToLive>
</DLQConfig>
</MDBConfig> |
Code: |
<!-- The WSMQ JMS provider loader -->
<mbean code="org.jboss.jms.jndi.JMSProviderLoader"
name="jboss.mq:service=JMSProviderLoader,name=WSMQJMSProvider">
<attribute name="ProviderName">WSMQJMSProvider</attribute>
<attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
<attribute name="QueueFactoryRef">MQQCF</attribute>
<attribute name="TopicFactoryRef">MQTCF</attribute>
<attribute name="Properties"> java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
java.naming.provider.url=file:/c:/java/jboss-4.0.1sp1/server
</attribute>
</mbean>
|
So MQQCF & MQTCF are factories configured with JMSAdmin, and also queues (eg queue/DLQ). With this setup there's no chance to pass in a userid to the createConnection() call, since it doesn't seem to be exposed as a parameter anywhere.
I wonder if this would require a tweak to the JBoss source? I'll dig a bit more.
Cheers,
Andrew |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon May 23, 2005 5:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
kolthorr wrote: |
I wonder if this would require a tweak to the JBoss source? I'll dig a bit more. |
Andrew check out JAAS and container authentication. If your JMS /J2EE implementation is above board, passing a container authenticated user/password should take care of it.
Remember though that in a bindings connection this cannot be different from the user running the WAS(JBoss).
Enjoy |
|
Back to top |
|
 |
kolthorr |
Posted: Mon May 23, 2005 6:42 am Post subject: SOLUTION: MQQueueConnectionFactory client id |
|
|
Apprentice
Joined: 09 Mar 2002 Posts: 31
|
Cool, thanks for that. I hadn't run into JAAS before but will check it out.
For posterity & anyone else trying to go down this route, another way around it was to use the <mdb-user> and <mdb-passwd> tags in the jboss.xml deployment descriptor when setting up the MDB <smacks head> - should have known that.
As for the DLQ handler, there are some sparsely-documented tags that you can use when configuring the handler (in 'standardjboss.xml'):
<DLQConfig>
<DLQUser>WSMQmcauser</DLQUser>
<DLQPassword>whatever</DLQPassword>
...
</DLQConfig>
Cheers,
Andrew |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|