jenkinsci / jms-messaging-plugin

https://plugins.jenkins.io/jms-messaging
12 stars 38 forks source link

Use durable queue consumers when subscribing jobs in ActiveMq #90

Closed ASzc closed 6 years ago

ASzc commented 6 years ago

For some reason bee4845, the commit that added queue support, didn't mirror the durability of topic subscriptions to queue consumers. I suspect this is the cause of sporadic dropped messages I've seen when the provider is configured to use queues.

ActiveMqMessagingWorker#subscribe is the smallest and most important change.

I applied a similar fix to ActiveMqMessagingWorker#waitForMessage and ActiveMqMessageWatcher#watch, but actual durability in those cases isn't possible without making them to retry on a timeout/error. I suspect that sporadic dropped messages will still be a problem when a job waits for a message while executing.

ASzc commented 6 years ago

Scratch that. Didn't notice in the JMS docs that a queue is not a valid input to createDurableConsumer. Apparently queues are inherently durable?

I'll need to look elsewhere to find where the messages are getting dropped.