-
Notifications
You must be signed in to change notification settings - Fork 140
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
jms queue purge #1230
Comments
cc: @turing85 |
I tried to find out what is happening and I think it could be related to
A scenario could be: 2. 3.
in the test is executed, it finds the message read by the topic consumer in the beginning I don't know how to avoid that interference itself, |
Hi @bbortt / @christophd , The question arose, whether: Optionally, if b) is the case: |
It is because you are using a JMS topic subscriber. The JMS topic broadcasts each message to all consumers subscribed. So purging the JMS topic will not affect other subscribers that have already received the message. In this specific case you need to also purge the endpoints meaning all Citrus topic subscribers, too. This is the nature of publish-subscribe topics compared to JMS queues. With JMS queue the purge operation on the queue itself would be sufficient without the purge on the Citrus endpoint. So option a) is not the right way, because many endpoints may consumer from one single queue/topic. Option b) is right only for JMS topics where you need to explicitly also purge the Citrus topic subscriber endpoints. Hope that helps. Any updates/improvements to the documentation are highly appreciated. Many thanks! |
Thanks, that cleared things up ! |
reported in https://citrusframework.zulipchat.com/#narrow/stream/259943-citrus/topic/Problems.20with.20purgeQueues.20action.
The purgeQueues-action does not work for me as expected; the queue does not seem to get purged.
For the setup: my system under tests receives a text/plain body via http/post and sends this body to an artemis topic.
For the test, I simply send some string to the system under test and then receive the corresponding JMS message. The JMS-setup on the citrus-side looks like this:
This works fine and as expected.
Now what I want to do is to clear the queue identified by the fqqn, so I implemented the following:
This does not work as expected. In a "normal run", the test is green. However, if the queue messages::citrus already exists (from a previous run for example) and I write some message to that queue and THEN trigger the tests, the validation fails. The test "sees" the message i send beforehand, so the cleanup that should be happening does not happfen. In fact, I debugged into PurgeJmsQueuesAction::purgeDestination and the message received was always null.
If you need a full reproducer: https://github.com/turing85/citrus-playground/tree/feature/before-test-sequence
To reproduce:
start artemis (
docker-compose --file local-deployment/docker-compose.yml up --detach
)start service (
./mvnw --projects service quarkus:dev
)run the citrus tests however you like
To send an interfering message to the queue, execute the following curl after the tests have run at least once (i.e. after the queue for citrus was created)`:
curl -v -X POST localhost:8080/send --data "ouch" --header "Content-Type: text/plain"
If you want to access the artemis broker, go to localhost:8161/console, credentials are artemis/artemis.****
The text was updated successfully, but these errors were encountered: