giraffi / fluent-plugin-amqp

Use AMQP broker to send or receive messages via FluentD
MIT License
15 stars 31 forks source link

Allow input plugin to automatically bind queue to known existing exchange #16

Closed warmfusion closed 8 years ago

warmfusion commented 8 years ago

When using both the input and output plugins, the output will write events to an exchange, and the input will read messages from a queue, however, no messages will flow unless the queues are bound to the exchange.

I propose that additional configuration is given to the input plugin such that it can automatically bind its queue to the appropriate exchange.

Example of changed configuration shows how this could be used to create unique queues for each AMQP output node, each consuming from the same upstream exchange - This would allow for multiple consumers, without any additional configuration or duplication of events (Assuming the exchange is set to 'direct' rather than 'fanout')

<source>
  type amqp
  host amqp.example.com
  port 5672
  vhost /
  user guest
  pass guest
  queue "fluent.reader.#{Socket.gethostname}"
  exchange "fluent.events"
  format json
</source>
sawanoboly commented 8 years ago

Good idea. I understood and agree it. But, I don't have enough time to add this function for a while. If possible, could you please implement it?

warmfusion commented 8 years ago

Sure thing; I'll try and improve the code coverage as I go.