You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2008/08/04 10:50:00 UTC
DO NOT REPLY [Bug 45458] Point to Point JMS in combination with
authentication
https://issues.apache.org/bugzilla/show_bug.cgi?id=45458
Ronald van de Kuil <ro...@nl.ibm.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ronald.van.de.kuil@nl.ibm.co
| |m
--- Comment #3 from Ronald van de Kuil <ro...@nl.ibm.com> 2008-08-04 01:49:59 PST ---
The code suggested on 2008-07-22 07:38 works for the RequestOnly sampler.
For the RequestResponse sampler I had to change the receiver as well.
I made the following changes:
In the class org.apache.jmeter.protocol.jms.sampler.Receiver I modified the 2
of its methods as follows:
private Receiver(QueueConnectionFactory factory, Queue receiveQueue, String
aUser, String aPassword) throws JMSException {
if (null != aUser && null != aPassword) {
log.info("creating receiver WITH authorisation credentials");
conn = factory.createQueueConnection(aUser, aPassword);
}else{
log.info("creating receiver without authorisation credentials");
conn = factory.createQueueConnection();
}
session = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
consumer = session.createReceiver(receiveQueue);
log.debug("Receiver - ctor. Starting connection now");
conn.start();
log.info("Receiver - ctor. Connection to messaging system established");
}
public static synchronized Receiver createReceiver(QueueConnectionFactory
factory, Queue receiveQueue, String aUser, String aPassword)
throws JMSException {
// if (receiver == null) {
Receiver receiver = new Receiver(factory, receiveQueue, aUser, aPassword);
Thread thread = new Thread(receiver);
thread.start();
// }
return receiver;
}
In short, I added the user name and password and logic to use it.
In the org.apache.jmeter.protocol.jms.sampler.JMSSampler class I made the
following change in the method threadStarted()
if (!useTemporyQueue()) {
receiveQueue = (Queue) context.lookup(getReceiveQueue());
receiverThread = Receiver.createReceiver(factory, receiveQueue,
getUser(context), getPassword(context));
}
This works for us here, we tested it this morning.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org