senseidb/sensei — pull request #7 by shixin86 (2013-02-22 09:27:54+00:00)
Title: Gw rabbitmq

Hi all:

As we know, RabbitMQ is a popular open-sourced messaging broker.
Recently, in our Mitalk team, we use RabbitMQ in many scenarios, I found there was already gateway plugin for Kafka, but not for RabbitMQ, so I wrote a gateway plugin for RabbitMQ.

Would you please review my code and help me to improve it? Waiting for your generously comments, thanks a lot !

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Configuration for RabbitMQ gateway in sensei.properties:

# rabbitMQ gateway parameters
sensei.gateway.class=com.senseidb.gateway.rabbitmq.RabbitMQDataProviderBuilder
sensei.gateway.rabbitmq.servers.names=server1,server2 # There may be multiple RabbitMQ servers.

sensei.gateway.server1.host=192.168.1.9
sensei.gateway.server1.exchange.name=userInfoUpdate_in_exchange
sensei.gateway.server1.exchange.type=direct
sensei.gateway.server1.exchange.durable=false
sensei.gateway.server1.queue.name=sensei_search_users_1
sensei.gateway.server1.queue.routing.key=userInfoUpdate
sensei.gateway.server1.queue.durable=true
sensei.gateway.server1.queue.exclusive=false
sensei.gateway.server1.queue.auto.delete=false
sensei.gateway.server1.consumer.count=5

sensei.gateway.server2.host=192.168.1.11
sensei.gateway.server2.exchange.name=userInfoUpdate_in_exchange
sensei.gateway.server2.exchange.type=direct
sensei.gateway.server2.exchange.durable=false
sensei.gateway.server2.queue.name=sensei_search_users_1
sensei.gateway.server2.queue.routing.key=userInfoUpdate
sensei.gateway.server2.queue.durable=true
sensei.gateway.server2.queue.exclusive=false
sensei.gateway.server2.queue.auto.delete=false
sensei.gateway.server2.consumer.count=5

sensei.gateway.maxpartition.id=79 # Total partition count is 80.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I have tested this plugin on my Sensei cluster!