Skip to content

Conversation

@ansd
Copy link
Member

@ansd ansd commented Jul 12, 2024

Arguments

  • rabbitmq:stream-offset-spec,
  • rabbitmq:stream-filter,
  • rabbitmq:stream-match-unfiltered are set in the filter field of the Source.
    This makes sense for these consumer arguments because:

A filter acts as a function on a message which returns a boolean result
indicating whether the message can pass through that filter or not.

Consumer priority is not really such a predicate.
Therefore, it makes more sense to set consumer priority in the properties field of the Attach frame.

We call the key rabbitmq:priority which maps to consumer argument x-priority.

While AMQP 0.9.1 consumers are allowed to set any integer data type for the priority level, this commit decides to enforce an int value (range -(2^31) to 2^31 - 1 inclusive).
Consumer priority levels outside of this range are not needed in practice.

Arguments
* `rabbitmq:stream-offset-spec`,
* `rabbitmq:stream-filter`,
* `rabbitmq:stream-match-unfiltered`
are set in the `filter` field of the `Source`.
This makes sense for these consumer arguments because:
> A filter acts as a function on a message which returns a boolean result
> indicating whether the message can pass through that filter or not.

Consumer priority is not really such a predicate.
Therefore, it makes more sense to set consumer priority in the
`properties` field of the `Attach` frame.

We call the key `rabbitmq:priority` which maps to consumer argument
`x-priority`.

While AMQP 0.9.1 consumers are allowed to set any integer data
type for the priority level, this commit decides to enforce an `int`
value (range -(2^31) to 2^31 - 1 inclusive).
Consumer priority levels outside of this range are not needed in
practice.
@ansd ansd added this to the 4.0.0 milestone Jul 12, 2024
@michaelklishin michaelklishin merged commit 6f67a85 into main Jul 13, 2024
@michaelklishin michaelklishin deleted the amqp-consumer-priority branch July 13, 2024 04:11
michaelklishin added a commit that referenced this pull request Jul 13, 2024
Support consumer priority in AMQP (backport #11705)
acogoluegnes added a commit to rabbitmq/rabbitmq-amqp-java-client that referenced this pull request Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants