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 » Specifying connection username with JMSAdmin

Post new topic  Reply to topic
 Specifying connection username with JMSAdmin « View previous topic :: View next topic » 
Author Message
kolthorr
PostPosted: Fri May 20, 2005 8:17 am    Post subject: Specifying connection username with JMSAdmin Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri May 20, 2005 11:59 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kolthorr
PostPosted: Mon May 23, 2005 2:46 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Mon May 23, 2005 5:51 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kolthorr
PostPosted: Mon May 23, 2005 6:42 am    Post subject: SOLUTION: MQQueueConnectionFactory client id Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Specifying connection username with JMSAdmin
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.