Skip to content

ARTEMIS-4692 Allow export of specific queues#6490

Open
hyperxpro wants to merge 1 commit into
apache:mainfrom
hyperxpro:ARTEMIS-4692-export-specific-queues
Open

ARTEMIS-4692 Allow export of specific queues#6490
hyperxpro wants to merge 1 commit into
apache:mainfrom
hyperxpro:ARTEMIS-4692-export-specific-queues

Conversation

@hyperxpro
Copy link
Copy Markdown
Contributor

Motivation:

data exp currently 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 --queue option to the data exp command (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 --queue value
that 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

@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.")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we do at an address level instead?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think of other users using multicast.. or a topic subscription.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants