Example usage for com.rabbitmq.client Consumer Consumer

List of usage examples for com.rabbitmq.client Consumer Consumer

Introduction

In this page you can find the example usage for com.rabbitmq.client Consumer Consumer.

Prototype

Consumer

Source Link

Usage

From source file:com.zuehlke.carrera.javapilot.show.ConfirmDontLoseMessages.java

License:Mozilla Public License

public static void main2(String[] args) throws IOException, InterruptedException {
    if (args.length > 0) {
        msgCount = Integer.parseInt(args[0]);
    }/*w  w  w. j ava2 s .c  o m*/

    connectionFactory = new ConnectionFactory();

    // Consume msgCount messages.
    (new Thread(new Consumer())).start();
    // Publish msgCount messages and wait for confirms.
    (new Thread(new Publisher())).start();
}

From source file:org.elasticsearch.river.rabbitmq.RabbitmqRiver.java

License:Apache License

@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();/*from  www.ja va 2  s . c  om*/
}