Skip to content

RabbitMQ custom exchange plugin: x-features

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE-MPL-RabbitMQ
Notifications You must be signed in to change notification settings

senseysensor/rabbitmq-x-features-exchange

Repository files navigation

RabbitMQ X-Featrues Exchange Type

This plugin adds a features exchange type to RabbitMQ. The exchange type is x-features, much like default rabbitMQ headers exchange but with different behaviour. See question on SO.

Shortly: consumers when bind to exchange, list their features as bind arguments (for instance, f1=true, country=US). Arguments starting with x- are ignored (are not used for routing). Publisher should list required features to process the message in headers. At least one header is required. Like in bindings, headers starting with x- are also ignored. In order message to be routed, ALL its headers (except those start with x-) should exactly match binding arguments. Given binding may have more arguments (available features) are not listed in message headers.

Additionally is available exchange argument pick_random which if is set to true will choose random binding if more than one binding fits conditions (otherwise if false or ommitted message will be routed to all bindings).

Installing

Build from source:

make rabbitmq-components-mk && make dist

then copy compiled plugin from directory plugins into rabbit plugins directory (by default is /usr/lib/rabbitmq/lib/rabbitmq_server-VERSION/plugins/).

More details about plugin building see in RabbitMQ Plugin Development Guide.

Disclamer

I am not expert in erlang (this was my first experience with the plugin). I took sources from headers exchange and random exchange plugin and managed implement this one. Would be glad for help, critic and pull requests.

License

See LICENSE.

Credits

Serge - sergeg.2kgroup@gmail.com

About

RabbitMQ custom exchange plugin: x-features

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE-MPL-RabbitMQ

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published