ARTEMIS-4692 Allow export of specific queues#6490
Conversation
| @Option(names = "undefined-prefix", description = "In case a queue does not exist, this will define the prefix to be used on the message export. Default: 'UndefinedQueue_'") | ||
| private String undefinedPrefix = "UndefinedQueue_"; | ||
|
|
||
| @Option(names = "--queue", description = "Only export the specified queue(s). Repeatable. When omitted, all queues are exported.") |
There was a problem hiding this comment.
shouldn't we do at an address level instead?
There was a problem hiding this comment.
think of other users using multicast.. or a topic subscription.
There was a problem hiding this comment.
I think queues make sense because that's where the messages live. We could add the same functionality for addresses, but I think that's orthogonal here.
There was a problem hiding this comment.
I was looking at this and had a similar thought, it might make sense at some point to have the same sort of option but at the address level but it seems to make sense to also have an option for the queue level
There was a problem hiding this comment.
The message is routed at an address, and a queue is just an add-reference.
for use cases with jms queues / anycast, using the address at the jms.queue level would give you what you need (the user mentioned DLQ, so using the DLQ address name would give you that).
For Multicast, I don't think it makes sense to do it at the queue level.
I would do this at the address level.
Also: It's worth mentioning the transfer/copy command that can allow you to move messages on a running broker for a selected queue.
There was a problem hiding this comment.
say you routed a message with Multicast orders... with two subscriptions....
does it make sense to export just one of the subscriptions?
perhaps it does... but most of the time the address is all you need.
There was a problem hiding this comment.
There are use-cases where exporting an address makes sense and use-cases where exporting a queue makes sense. The broker's address model provides flexibility (e.g. using FQQN) to support lots of different use-cases. The export command should have some of this flexibility as well. We can always implement address export later.
Motivation:
data expcurrently exports every queue, address binding, and message found in a broker's journal or paging store. In practice, operators often only need data from a specific queue and most commonly the Dead Letter Queue (DLQ). Today, that requires exporting everything and manually filtering the resulting XML afterward.Modification:
Added a repeatable
--queueoption to thedata expcommand (XmlDataExporter).When set, the exporter emits only the named queue bindings, the address
bindings that host them, and only the messages routed to those queues (each
message's
<queues>list is trimmed to the matching queues). A--queuevaluethat matches no binding is reported on stderr so a typo doesn't silently
produce an empty export. When the option is omitted the behaviour is unchanged
(all queues are exported), and the filtered output remains valid, importable XML.
Result:
Fixes: ARTEMIS-4692