There are two programs: subscriber and publisher... Subscriber is able to put the message onto the topic and the message is sent successfully. When I check the activemq serv
Your issue is that your consumer is running and then shutting down immediately.
Try adding this into your consumer:
consumer.setMessageListener(listner);
try {
System.in.read();
} catch (IOException e) {
e.printStackTrace();
}
connection.close();
This will wait until you hit a key before stopping.
Other things to consider: