Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARTEMIS-5131 Add A Copy message button to console #5316

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andytaylor
Copy link
Contributor

This exposes a copyMessage method that simply copies a message to a different queue so the new console can add a copy button

@@ -2618,6 +2618,60 @@ public void testMoveMessage() throws Exception {
session.deleteQueue(otherQueue);
}

@TestTemplate
Copy link
Contributor

@tabish121 tabish121 Oct 23, 2024

Choose a reason for hiding this comment

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

For adding a feature like this you should ideally write a test that covers more of the protocols and messages (normal or large) as well as times when paging is happening vs not as there have been a number of cases lately where a breakage or misbehavior has been found when an AMQP or a Large message was involved in internal management code such as this.

Refer to test: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/BeforeSendPluginTest.java for some inspiration

throw ActiveMQMessageBundle.BUNDLE.noQueueFound(targetQueue);
}

return queue.copyReference(messageID, binding.getAddress(), binding);
Copy link
Contributor

Choose a reason for hiding this comment

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

The implementation details here should be part of the Queue::copyReference.

Also... what if the targetQueue was passed a topic.

Shouldn't this call PostOffice::route instead?...

on that case targetQueue here should be targetAddress...

I started writing a test to validate this test and I bumped into that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As with the move method this is adding directly to a queue, rerouting it would send it to all queus on an address which is wrong. I could do use route and add rout-to-id of the queue but would there be any benefit to doing that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually ignore, if you follow the code thru it does use rout on the binding itself so it only goes to that queue

@clebertsuconic
Copy link
Contributor

I sent a PR for a test that's not working at the moment, but it would give you an idea of a test to be written...

as I said before I think the method should be updated.

@clebertsuconic
Copy link
Contributor

@andytaylor also.. I just thought... how security handled on the security settings on the copy?

I don't think this is checking security.. is it?

and I still think it should go through the PostOffice so you can copy for a topic for instance?

@andytaylor
Copy link
Contributor Author

@andytaylor also.. I just thought... how security handled on the security settings on the copy?

I don't think this is checking security.. is it?

and I still think it should go through the PostOffice so you can copy for a topic for instance?

I don't sww how the topic instance makes any difference as it is just being moved between queues?

@andytaylor
Copy link
Contributor Author

I have added tests for each protocol, large messages and some around paging. one paging test copies to a queue on the same address and makes sure it is also paged

This exposes a copyMessage method that simply copies a message to a different queue so the new console can add a copy button
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.

3 participants