~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/rabbitmq/rabbitmq_log.cc

  • Committer: Monty Taylor
  • Date: 2010-12-05 07:35:32 UTC
  • mfrom: (1974 b)
  • mto: (1975.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1976.
  • Revision ID: mordred@inaugust.com-20101205073532-hehqwv27pbd7byjm
Merged source.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23
23
 */
24
24
 
25
 
#include <config.h>
 
25
#include "config.h"
26
26
#include "rabbitmq_log.h"
27
27
#include <drizzled/message/transaction.pb.h>
28
28
#include <google/protobuf/io/coded_stream.h>
46
46
/**
47
47
 * rabbitmq port
48
48
 */
 
49
typedef drizzled::constrained_check<in_port_t, 65535, 0> port_constraint;
49
50
static port_constraint sysvar_rabbitmq_port;
50
51
 
51
52
 
69
70
  uint8_t* buffer= new uint8_t[message_byte_length];
70
71
  if(buffer == NULL)
71
72
  {
72
 
    errmsg_printf(error::ERROR, _("Failed to allocate enough memory to transaction message\n"));
 
73
    errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to allocate enough memory to transaction message\n"));
73
74
    deactivate();
74
75
    return plugin::UNKNOWN_ERROR;
75
76
  }
84
85
  }
85
86
  catch(exception& e)
86
87
  {
87
 
    errmsg_printf(error::ERROR, _(e.what()));
 
88
    errmsg_printf(ERRMSG_LVL_ERROR, _(e.what()));
88
89
    deactivate();
89
90
    return plugin::UNKNOWN_ERROR;
90
91
  }
114
115
  } 
115
116
  catch (exception& e) 
116
117
  {
117
 
    errmsg_printf(error::ERROR, _("Failed to allocate the RabbitMQHandler.  Got error: %s\n"),
 
118
    errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to allocate the RabbitMQHandler.  Got error: %s\n"),
118
119
                  e.what());
119
120
    return 1;
120
121
  }
127
128
  } 
128
129
  catch (exception& e) 
129
130
  {
130
 
    errmsg_printf(error::ERROR, _("Failed to allocate the RabbitMQLog instance.  Got error: %s\n"), 
 
131
    errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to allocate the RabbitMQLog instance.  Got error: %s\n"), 
131
132
                  e.what());
132
133
    return 1;
133
134
  }
152
153
{
153
154
  context("host", 
154
155
          po::value<string>()->default_value("localhost"),
155
 
          _("Host name to connect to"));
 
156
          N_("Host name to connect to"));
156
157
  context("port",
157
158
          po::value<port_constraint>(&sysvar_rabbitmq_port)->default_value(5672),
158
 
          _("Port to connect to"));
 
159
          N_("Port to connect to"));
159
160
  context("virtualhost",
160
161
          po::value<string>()->default_value("/"),
161
 
          _("RabbitMQ virtualhost"));
 
162
          N_("RabbitMQ virtualhost"));
162
163
  context("username",
163
164
          po::value<string>()->default_value("guest"),
164
 
          _("RabbitMQ username"));
 
165
          N_("RabbitMQ username"));
165
166
  context("password",
166
167
          po::value<string>()->default_value("guest"),
167
 
          _("RabbitMQ password"));
 
168
          N_("RabbitMQ password"));
168
169
  context("use-replicator",
169
170
          po::value<string>()->default_value("default_replicator"),
170
 
          _("Name of the replicator plugin to use (default='default_replicator')"));
 
171
          N_("Name of the replicator plugin to use (default='default_replicator')"));
171
172
  context("exchange",
172
173
          po::value<string>()->default_value("ReplicationExchange"),
173
 
          _("Name of RabbitMQ exchange to publish to"));
 
174
          N_("Name of RabbitMQ exchange to publish to"));
174
175
  context("routingkey",
175
176
          po::value<string>()->default_value("ReplicationRoutingKey"),
176
 
          _("Name of RabbitMQ routing key to use"));
 
177
          N_("Name of RabbitMQ routing key to use"));
177
178
}
178
179
 
179
180
} /* namespace drizzle_plugin */