List of usage examples for com.rabbitmq.client Channel basicQos
void basicQos(int prefetchCount, boolean global) throws IOException;
From source file:com.paxxis.cornerstone.messaging.service.amqp.AMQPServiceBusConnector.java
License:Apache License
public Session createSession() { try {/*from w w w. j av a 2 s. co m*/ Channel channel = connection.createChannel(); channel.exchangeDeclare(exchangeName, exchangeType, true); //max messages in flight per consumer (false means consumer, true means per channel) channel.basicQos(maxMessagesInFlight, false); return new AMQPSession(channel, exchangeName, getAcknowledgeMode() == Session.AUTO_ACKNOWLEDGE); } catch (IOException e) { throw new RuntimeException(e); } }