Example usage for com.rabbitmq.client Channel confirmSelect

List of usage examples for com.rabbitmq.client Channel confirmSelect

Introduction

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

Prototype

Confirm.SelectOk confirmSelect() throws IOException;

Source Link

Document

Enables publisher acknowledgements on this channel.

Usage

From source file:vn.com.uet.performance.rabbitmq.MulticastParams.java

License:Open Source License

public Producer createProducer(Connection connection, Stats stats, String id) throws IOException {
    Channel channel = connection.createChannel();
    if (producerTxSize > 0)
        channel.txSelect();/*  ww  w .j a v a 2s  . c  o  m*/
    if (confirm >= 0)
        channel.confirmSelect();
    if (!predeclared || !exchangeExists(connection, exchangeName)) {
        channel.exchangeDeclare(exchangeName, exchangeType);
    }
    final Producer producer = new Producer(channel, exchangeName, id, randomRoutingKey, flags, producerTxSize,
            producerRateLimit, producerMsgCount, minMsgSize, timeLimit, confirm, stats);
    channel.addReturnListener(producer);
    channel.addConfirmListener(producer);
    return producer;
}