Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Transient endpoints and returning un-routed messages #101

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jpwilliams
Copy link
Owner

@jpwilliams jpwilliams commented Dec 1, 2019

Closes #43, but also related to #45 and #58.

Was a discussion way back when about whether we should change endpoints to be transient by default rather than persist even when they have no consumers available. We settled on transient by default, but never actually implemented the changes.

This should clear things up and comes with the added bonus of mandatory: true messages, meaning if a request is sent and cannot be routed to any endpoints, it immediately returns. In terms of "failing fast", this is ace.

If people want to use the old behaviour then, well, they can't. Turning the option on or off would mean managing two different queues for the same endpoint where consumers could only consume from one at a time. That just isn't reasonable.

This is unfortunately a breaking change though. Even though the API doesn't change, the nonequivalent queue parameters means that RabbitMQ queues have to be recreated to work, meaning people's setups will break if they upgrade.

This has been long-awaited. With this, requests can "fail fast" and
immediately return if no consumers are available instead of hanging
around for 30 seconds waiting for another instance to pop up.

This is, however, a breaking change.
This solves an issue where an endpoint loses all consumers, closes the
queue and then a consumer attempts to "resume" and can't find the queue
any more.

Technically this could've happened previous to this `mandatory` change
in a particular set of circumstances, so this is a good fix.
@jpwilliams jpwilliams requested a review from jacktuck December 1, 2019 18:34
@jpwilliams jpwilliams marked this pull request as ready for review December 1, 2019 18:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detect if a request cannot be routed and return immediately
1 participant