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

Allow multiple input queues with precendence #1

Closed
bitzl opened this issue Jan 17, 2018 · 0 comments
Closed

Allow multiple input queues with precendence #1

bitzl opened this issue Jan 17, 2018 · 0 comments

Comments

@bitzl
Copy link
Member

bitzl commented Jan 17, 2018

Use Case

There are multiple projects with items to process. Because items from one project always have priority over others multiple queues are used. Processing these items takes a lot of resources, so running one worker for each queue is not feasible.

Suggested solution

Add the possibility to configure multiple input queues with precedence in the same order as the queues are added. Then check each queue in order for a new message until the first message is retrieved. This way, any subsequent queue will only be queried if the queue before was empty, ensuring expected precendence of processing.

Example:

MessageBroker messageBroker = new MessageBrokerBuilder()
        .readFrom("input.priority1", "input.priority2", "input.priority3")
        ...

would mean that first all messages from input.priority1 will be processed. When input.priority1 is empty, then messages from input.priority2 will be processed. And if input.priority1 and input.priority2 are both empty, then messages from input.priority3 will be processed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant