ACTIVEMQ- publisher subscriber hello world example

前端 未结 4 824
北恋
北恋 2020-12-13 15:02

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

4条回答
  •  Happy的楠姐
    2020-12-13 15:21

    just some:

    • work with a queue not a topic. messages in topics will be discarded when no consumer is available, they are NOT persistend.
    • add connection.start() after setting the message listener. you should start a connection when all consumers/producers are properly set up.
    • wait some time before before closing the connection again.

    the topic will probably be your most important source of failure.

提交回复
热议问题