activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pkleczka <pklec...@gmail.com>
Subject Command agent and Smack API
Date Mon, 07 Nov 2011 16:54:33 GMT
Hi

I am using ActiveMQ 5.4.2 and trying to connect to the Command Agent using
Smack 3.2.1. I connect, but do not get any messages back. Your help is
appreciated. Below is the code:

	@Test
	public void testSmack() {
		
		try
		{
			ConnectionConfiguration connConfig = new
ConnectionConfiguration("localhost", 61222);
			Connection connection = new XMPPConnection( connConfig );

			connection.connect();
			connection.login("sysuser", "syspass");
			Chat chat = connection.getChatManager().createChat("ActiveMQ.Agent", new
MessageListener() 
			{
				
				
				
				@Override
			    public void processMessage(Chat chat, Message message) {
			        System.out.println("Received message: " + message);
			    }
	
	
			}
			);
			
			System.err.println("Chat message listener created...");
			chat.sendMessage("query -QTopic=*");
			System.err.println("Chat message sent...");
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		
	}

--
View this message in context: http://activemq.2283324.n4.nabble.com/Command-agent-and-Smack-API-tp4006075p4006075.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message