logstash-plugins / logstash-output-rabbitmq

Apache License 2.0
17 stars 37 forks source link

Allow custom exchange types #51

Closed CVTJNII closed 8 years ago

CVTJNII commented 8 years ago

It is possible to install other RabbitMQ exchange types via plugins. An example of this is the [https://github.com/rabbitmq/rabbitmq-consistent-hash-exchange](x-consistent-hash exchange) which I wish to use with Logstash to help with performance problems caused by high logging throughput. However, the output plugin validates the exchange type at rabbitmq.rb line 31 against only the three defaults, leading to the following error:

{:timestamp=>"2016-06-27T22:48:55.743000+0000", :message=>"Invalid setting for rabbitmq output plugin:\n\n  output {\n    rabbitmq {\n      # This setting must be a [\"fanout\", \"direct\", \"topic\"]\n      # Expected one of [\"fanout\", \"direct\", \"topic\"], got [\"x-consistent-hash\"]\n      exchange_type => \"x-consistent-hash\"\n      ...\n    }\n  }", :level=>:error}

It would be nice if this output was tolerant of other exchange types installed via Rabbit plugins.

output {
  rabbitmq {
    exchange => "es"
    exchange_type => "x-consistent-hash"
    host => [Host]
    port => "5671"
    user => "es"
    password => [Password]
    vhost => "/es"
    ssl => true
  }
}
CVTJNII commented 8 years ago

Looks like the mixin supports this type in 4.0 which is in the latest container.