https://github.com/krisleech/wisper-rabbitmq
Relay Wisper events to RabbitMQ
https://github.com/krisleech/wisper-rabbitmq
Last synced: 11 months ago
JSON representation
Relay Wisper events to RabbitMQ
- Host: GitHub
- URL: https://github.com/krisleech/wisper-rabbitmq
- Owner: krisleech
- License: mit
- Created: 2015-02-16T23:24:21.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-11-16T14:01:24.000Z (over 10 years ago)
- Last Synced: 2025-03-17T04:44:47.491Z (about 1 year ago)
- Language: Ruby
- Size: 105 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Wisper::RabbitMQ [WIP]
Relay Wisper events to RabbitMQ.
## Installation
```ruby
gem 'wisper-rabbitmq'
```
## Usage
```ruby
Wisper::RabbitMQ.enable
```
The above will forward all events to RabbitMQ with the following defaults:
* Host: `amqp://guest:guest@localhost:5672`
* VirtualHost: `/`
* Exchange: `fanout`
* Queue: `wisper`
## Configuration
```ruby
Wisper::RabbitMQ.configure do |config|
config.host = '...'
# or
config.connection = my_connection
end
```
`my_connection` must be a [Bunny]() compatible client. This is useful on JRuby
as it allows use of the more performant [Hare]() library.
And the other, optional, configurables:
```ruby
config.virtual_host = 'myapp'
config.queue = 'default'
```
The value for each configurable can also be a callable object, e.g.
```ruby
config.virtual_host = ->(event) { ... }
```
### Whitelisting
You can filter which events are relayed to RabbitMQ using a callable object:
```ruby
Wisper::RabbitMQ.configure do |config|
config.relay_events = ->(event_name) { %w(:thing_created).include?(event_name) }
end
```
## Contributing
Yes, please.