1
#ifndef PLUGIN_RABBITMQ_LOG_RABBITMQ_LOG_H
2
#define PLUGIN_RABBITMQ_LOG_RABBITMQ_LOG_H
3
#include <drizzled/replication_services.h>
4
#include <drizzled/plugin/transaction_applier.h>
6
#include "rabbitmq_handler.h"
11
* A TransactionApplier that sends the transactions to rabbitmq
12
* (or any AMQP 0-8 compliant message queue)
15
* Connects to rabbitmq server in constructor, publishes messages
16
* in apply(...). If error occurs, the plugin disables itself.
18
class RabbitMQLog: public drizzled::plugin::TransactionApplier
21
RabbitMQHandler* rabbitMQHandler;
26
* Constructs a new RabbitMQLog.
29
* Takes an instance of RabbitMHandler and uses that for rabbitmq communication
31
* @param[in] mqHandler name of the plugin, typically rabbitmq_log.
33
RabbitMQLog(const std::string name_arg,
34
RabbitMQHandler* mqHandler);
39
* Serializes the transaction and uses a RabbiMQHandler to publish the message.
42
* Serializes the protobuf transaction and drops it on rabbitmq
44
* @param[in] to_apply the transaction to send
46
void apply(const drizzled::message::Transaction &to_apply);