0

I'm a fresh user of ActiveMQ technology, and I have some problem approaching this technology.

I have the following situation:

  1. I have a SW, running in a embedded (offline) ARM device, that archive a set of videos on a upluggable hard disk at run time.
  2. Sometimes (4-5 events a day), I have to associate a alarm event to those videos and to queue the alarm on a persistent queue.
  3. Once a month we have to extract the hard disk and to connect it to another embedded online ARM device, that should notify a ActiveMQ server about the alarms generated by the offline ARM device

And now my question: how can I store the persistent queue on the hard disk, so that the events generated byt the offline ARM device will be available to the online ARM system (the only "connection" between online and offline embedded device is hard disk)?

Please note that I cannot change the way I transmit messages to the online server, since it is a system not developed by my company.

Best regards

Giovanni

Giox79
  • 124
  • 11

1 Answers1

1

It sounds like you want a "store-and-forward" messaging pattern. You could configure the "offline" ActiveMQ broker to attempt to connect to the "online" ActiveMQ broker. The network connector will attempt to connect at configurable intervals and when it is "online" it will begin to send messages automatically.

The slight down side is that the broker will attempt to connect to the remote broker (even when offline), so you'll need to manage log rotation or logging levels to accommodate.

Look for the static:// network connector uri

Network of brokers

Matt Pavlovich
  • 4,087
  • 1
  • 9
  • 17
  • Hi Matt, I think I understand the suggested approach. Using static connector, if board A is offline for 2 days and the third day is connected to the host C running the "server", the queued messages will be delivered fine. However I have a doubt related to my system: device A is offline and generates messages; the hard disk, once a week, is disconnected from A and connected to B, a board with the same SW running on A, but connected to the ActiveMq server broker. I don't understand how to allow messages generated by ActiveMq on board A to be delivered to server C by board B. – Giox79 Jun 20 '17 at 14:31
  • If the storage location of the ActiveMQ kahadb files is in the same directory across all boards and the ActiveMQ version is the same: the SW on board B should fire up the broker, read the messages stored on the hard drive from A and deliver to server C just fine. – Matt Pavlovich Jun 20 '17 at 16:07
  • Another option might be to take a compensating transaction or file-system-as-a-queue approach. Store the files in a folder, have a process detect when the storage is attached (filesystem monitor, or cron job) and then publish the messages to the broker on server C when a connectivity test passes. – Matt Pavlovich Jun 20 '17 at 16:09