Hi,

We have used the JMS sampler with authentication with WebLogic and it
(nearly) works - I think what we have done should be applicable for you as
well. The "nearly" is because we have had to open a support case with BEA on
an issue we are having with JMS authorisation (i.e. after authentication),
but I dont think this will affect you.

Anyway, what we needed to do to use authentication was to add the properties
for authentication to the JNDI properties section of the JMS sampler. 

The properties we added were "java.naming.security.principal" (username) and
"java.naming.security.credentials" (password). 

If you look at the JMeter code, you will see it adds all properties from this
section to the Initial context, so you shouldn't have to change the code at
all. 

Note - the two properties we are adding correspond to the values of the Java
static variables Context.SECURITY_PRINCIPAL and Context.SECURITY_CREDENTIALS.
If we were coding a standalone Java client to connect our JMS server, these
are the variables we would reference when supplying authentication details.
Eg. - 

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "http://127.0.0.1:7001";);
env.put(Context.SECURITY_PRINCIPAL, "weblogic"); 
env.put(Context.SECURITY_CREDENTIALS, "weblogic"); 
InitialContext ic = new InitialContext(env);
QueueConnectionFactory qconFactory = (QueueConnectionFactory)
ic.lookup("myConnFact");
QueueConnection qcon = qconFactory.createQueueConnection();
qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
QueueSession queue = (Queue) ic.lookup("myQueue");
QueueSender qsender = qsession.createSender(queue);

I'm not familar with MQSeries, but if that Java code would look different for
you JMS clients, then you'll need to adjust the way you use the JMS sampler
accordingly.

Hope this helps - let me know how you get on!

Regards,

Adrian


-----Original Message-----
From: Ronald Van de Kuil [mailto:[EMAIL PROTECTED]
Sent: 17 July 2008 15:24
To: JMeter Users List
Cc: Dick Sol
Subject: JMS in combination with authentication


Hello JMeter users,

I have figured out how to send JMS messages to IBM MQSeries. We can send 
messages to a queue manager which is not secured with a user and a 
password.

The trick is easy:
- use the com.sun.jndi.fscontext.RefFSContextFactory class as initial 
context factory with a url to the JNDI repository;
- use IBM JMSAdmin tool to create a JNDI mapping between your JMS world 
and the MQ world in your JNDI repository;

We are trying to take it a step further by sending a message to a 
queuemanager that has a user and a password set.

Unfortunatly we have been struggling with getting it to work for a two 
days now after having tried various approaches.

I can see in the source of jmeter that all calls to the queue connection 
factory are of the type:

public QueueConnection createQueueConnection() throws JMSException

Am I right that I will have to modify the code of jmeter to get it to 
supply the user and password. Like as in:

public QueueConnection createQueueConnection(String userName, String 
password) throws JMSException

Can anyone advise me on what to do next?


Thanx / Met Vriendelijke Groet,
Ronald van de Kuil

Stuck in the past somewhere in the future? NO WAY!!!

Tenzij hierboven anders aangegeven: / Unless stated otherwise above:
IBM Nederland B.V.
Gevestigd te Amsterdam
Inschrijving Handelsregister Amsterdam Nr. 33054214


************************

This message has been delivered to the Internet by the Revenue Internet e-mail 
service (OP)

*************************

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to