activemq-artemis icon indicating copy to clipboard operation
activemq-artemis copied to clipboard

ARTEMIS-3834 Include paged messages when running "Send messages to DLA"

Open AntonRoskvist opened this issue 3 years ago • 13 comments

AntonRoskvist avatar May 16 '22 11:05 AntonRoskvist

I'm running the whole test suite on a CI box I have access and if all good will merge this...

thanks.

clebertsuconic avatar May 16 '22 20:05 clebertsuconic

@AntonRoskvist do you mind fixing QueueControlUsingCoreTest.testSendToDLAIncludesPagedMessages ?

clebertsuconic avatar May 17 '22 13:05 clebertsuconic

@clebertsuconic Sure no problem, what is the issue you are seeing?

AntonRoskvist avatar May 17 '22 13:05 AntonRoskvist

QueueControlUsingCoreTest extends the test you wrote to try management through core messages there's a proxy, and there's a failure because:

Error Message class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')

Basically the proxy method you wrote seems wrong.

if you can't fix it.. I will figure out later...

clebertsuconic avatar May 17 '22 13:05 clebertsuconic

You should be able to run the test through Idea... what makes my workflow simple...

if you don't have your environment set to run these tests... just let me know if you wouldn't be able to.

clebertsuconic avatar May 17 '22 13:05 clebertsuconic

Sure no problem, I'll give that a try right away

AntonRoskvist avatar May 17 '22 13:05 AntonRoskvist

@clebertsuconic I fixed it so the test passes but I'm not 100% sure this is the correct fix... to be honest I cannot really figure out why it receives a Long as response instead of the expected Integer... stepping through the code with a debugger I can see that the actual return value from "QueueImpl#sendMessagesToDeadLetterAddress()" is an int just like before the change but I guess it gets cast at some point along the way?

AntonRoskvist avatar May 18 '22 07:05 AntonRoskvist

Travis CI failed at: testSoakHornetQ(org.apache.activemq.artemis.tests.compatibility.HornetQSoakTest) but only for jdk11... I'm assuming that's unrelated for now

AntonRoskvist avatar May 18 '22 10:05 AntonRoskvist

The real way to fix QueueControlUsingCoreTest is just to tell invokeOperation to cast it to an Integer.class, e.g.:

         @Override
         public int sendMessagesToDeadLetterAddress(final String filterStr) throws Exception {
            return (Integer) proxy.invokeOperation(Integer.class, "sendMessagesToDeadLetterAddress", filterStr);
         }

That said, I'm concerned that this introduces an inconsistency with sendMessageToDeadLetterAddress(long) which doesn't include paged messages. I think either both of these methods should work on paged messages or neither of them should.

Thoughts?

jbertram avatar May 23 '22 19:05 jbertram

I agree, that makes sense. I will fix both the test and also make sure that the sendMessageToDeadLetterAddress(long) includes paged messages. Thanks

AntonRoskvist avatar May 23 '22 20:05 AntonRoskvist

@jbertram @clebertsuconic Hope this is looking better, otherwise just let med know.

AntonRoskvist avatar May 24 '22 18:05 AntonRoskvist

Don't really know why the build test for JDK11 failed TBH, it was successful on the same job in my repo and locally...

AntonRoskvist avatar May 24 '22 18:05 AntonRoskvist

@AntonRoskvist I have authorization set to re-run failing jobs. I will re-run it as soon as the current workflow finishes. Thanks!

clebertsuconic avatar May 24 '22 18:05 clebertsuconic