You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by pkleczka <pk...@gmail.com> on 2011/11/07 17:54:33 UTC

Command agent and Smack API

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.