thrift code with my changes to support rabbitmq