Reputation: 77
I am trying to implement ActiveMQ Artemis. Is Artemis part of ActiveMQ?
I am trying to make periodical tasks delay-and-schedule-message-delivery ActiveMQ, but the only thing which is working is delayed scheduled-messages. There is the note about the core API in the documentation:
Scheduled messages can also be sent using the core API, by setting the same property on the core message before sending.
So it probably doesn't mean that I can set ActiveMQ properties.
I need any message queue with these features:
Upvotes: 0
Views: 2261
Reputation: 35008
Apache ActiveMQ Artemis is a message broker which is part of the ActiveMQ project. However, it is separate from the "classic" ActiveMQ broker code-base. It is based on a newer, fundamentally non-blocking design and it supports all of the protocols and much of the same functionality as ActiveMQ 5.x. The current goal in the ActiveMQ community is that Artemis will become the 6.x version of ActiveMQ.
- Repeating tasks (ActiveMQ "Classic")
You can use scheduled delivery but that only applies for a single message. Once that message is delivered and consumed it's gone which means you'll need to send another scheduled message. There is not automated, repeated delivery of the same message.
Something like the quartz scheduler might be a good solution here because you could schedule all the tasks with it, and the scheduled task could send a message to a queue which is being monitored by your distributed workers. In this way you could separate the scheduling from the work distribution.
- Duplicate task detection (ActiveMQ Artemis)
Artemis supports something called a "last-value queue" where you can set a special property on a message to a particular value (e.g. a task ID) and whenever you send a message to the queue with that same value it will replace the existing message with the one you sent. In other words, it always has the last value you sent. You can read more about this in the Artemis documentation on last-value queues.
There's also classic duplicate detection where you can set a duplicate ID on a message and if the broker sees a repeated duplicate ID it will discard the message with the repeated duplicated ID. You can read more about this in the Artemis documentation on duplicated detection.
- Data persistence
By default any message marked as durable
(or persistent
in JMS terms) which is sent to a durable queue (queues are durable by default) will be persisted to disk.
- Message modification - remove from the queue or change repeating delay
Messages on the queue are immutable so you can't edit them technically, but you can use the semantics of a last-value queue to get similar behavior (e.g. send a modified message with the same last-value property and it will replace the existing message).
- Spring integration
ActiveMQ Artemis is a JMS implementation so all the JMS integration classes available in Spring will work just fine.
Upvotes: 5