简体   繁体   中英

Android Stomp reconnect to ActiveMQ


I am using some Stomp library for android. I already success to create connection and consume message from ActiveMQ. But now I have a problem.
Every time the client(android) lost connection(like no internet), it seems that the connection to activeMQ not properly shutdown, so when I try to reconnect, it always make a new consumer for the destination queue. What I want is the android will reconnect using the same session as before so it will not create a new consumer for the queue. Can someone help me to do something like this?

ActiveMQ identifies its durable STOMP subscriber with a client-id and subscriptionName . Client-id should be specified in the CONNECT message and subscriptionName should be specified in the SUBSCRIBE message. So, if you make sure that your subscriber uses the same client-id, subscriptionName combination every time it reconnects the ActiveMQ server, it should be treated as single client.

Please see ActiveMQ STOMP Docs for more information, specifically ActiveMQ extensions to Stomp section.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM