severb/graypy — pull request #19 by pwyliu (2013-02-15 22:35:13+00:00)
Title: Using different exchange types

Hi,

The new version of Graylog2 (0.10.0) handles AMQP a little bit differently than before. Now you are supposed to create a topic exchange and then Graylog2 binds a temporary queue to it. More detail:

http://support.torch.sh/help/kb/graylog2-server/using-the-amqp-input

This breaks graypy because the 'fanout' type is hard coded in RabbitSocket, so when you try to connect to a 'topic' type exchange on the server amqplib will spit out an error.

This is a pull request with a quick fix that adds an additional parameter so can specify the type, if you need to. Example:

```python
handler = graypy.GELFRabbitHandler('amqp://user:pass@myhost', 'logging-gelf', exchange_type='topic')
```

Then you can connect to RabbitMQ without problems.