activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From loganathan <>
Subject Problem in VM broker url along with simpleAuthenticationPlugin in activemq
Date Thu, 27 Jun 2013 09:03:00 GMT
Below is sample test code for connecting to tcp broker url and the
tcp://localhost:61616 url and simpleAuthenticationPlugin also configured in
context-activemq.xml below code is working fine if I given wrong username
and password its showing exception as "wrong username" but what's my problem
instead of tcp broker url and have acheives through vm broker url.

suppose if i configured vm://BrokerDefault url and
simpleAuthenticationPlugin in context-activemq.xml on that scanerio even if
i given wrong username and password the below code is not showing any
exception as "wrong username" how i can acheived it through vm broker url.Is
anyone help for this issue would be highly appreciated?
public class ExampleCheck {

	private static final org.apache.commons.logging.Log log =

	public static void main(String[] args) {
		ConnectionFactory connectionFactory = null;
		Connection connection = null;
		Session session = null;
		Queue queue = null;
		MessageProducer producer = null;
		final int NUM_MSGS = 20;

		final String url = "tcp://localhost:61616";

		try {
			connectionFactory = new ActiveMQConnectionFactory(url);"Got ConnectionFactory");

			connection = connectionFactory.createConnection("logu", "gafoor");"Got Connection");

			session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);"Got Session");

			queue =
session.createQueue("jms:queue:Testsubscription1.outbound.queue");"Got Destination");

			producer = session.createProducer(queue);"Got Producer");

			TextMessage message = session.createTextMessage();

			for (int i = 0; i < NUM_MSGS; i++) {
				message.setText("This is message " + (i + 1));"Sending message: " + message.getText());


		} catch (Exception e1) {

		} finally {
			if (connection != null) {
				try {
				} catch (JMSException e) {

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message