简体   繁体   中英

ActiveMQ Producer Intermittent Connection and Persistence

I am currently trying to find a solution for persistently delivering data through a producer over TCP. The connection can go down for long periods of time.

Does this mean I need to implement my own form of persistence for data while I wait for the connection to be made? Or is there some method such as failover, where ActiveMQ can wait for the connection to be reconnected and then persistently deliver the messages. My current problem is that I cannot create a producer if there is no connection, so my messages have nowhere to go during the time it takes to form a connection.

I have no problem using my own form of persistence, but I would rather use the built in persistence that ActiveMQ provides.

I hope my question is clear.

This is a common concern and can be solved in a few ways. One way is the method you've described where you store the data yourself and send it when the connection comes back up. Another approach that is often used is to use an embedded or local broker to produce the messages to and create a network connection between the local broker and the remote. When the connection is down the embedded broker will store the messages and when the network connection between the brokers is restored the local can forward the stored messages onto the remote broker (hub and spoke sort of). Keep in mind that the local broker needs sufficient storage to manage the number of messages you expect to accumulate during typical downtime between the local and remote broker.

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