@Override
  public void start() {
    connectionFactory = new ConnectionFactory();
    connectionFactory.setUsername(rabbitUser);
    connectionFactory.setPassword(rabbitPassword);
    connectionFactory.setVirtualHost(rabbitVhost);
    connectionFactory.setRequestedHeartbeat(new Long(rabbitHeartbeat.getSeconds()).intValue());

    logger.info(
        "creating rabbitmq river, addresses [{}], user [{}], vhost [{}]",
        rabbitAddresses,
        connectionFactory.getUsername(),
        connectionFactory.getVirtualHost());

    thread =
        EsExecutors.daemonThreadFactory(settings.globalSettings(), "rabbitmq_river")
            .newThread(new Consumer());
    thread.start();
  }
예제 #2
0
 @Override
 public synchronized void start() {
   setDaemon(true);
   super.start();
 }