Search in sources :

Example 1 with ActiveMQConsumerContext

use of org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQConsumerContext in project activemq-artemis by apache.

the class HornetQClientSessionContext method createConsumer.

@Override
public ClientConsumerInternal createConsumer(SimpleString queueName, SimpleString filterString, int windowSize, int maxRate, int ackBatchSize, boolean browseOnly, Executor executor, Executor flowControlExecutor) throws ActiveMQException {
    long consumerID = idGenerator.generateID();
    ActiveMQConsumerContext consumerContext = new ActiveMQConsumerContext(consumerID);
    SessionCreateConsumerMessage request = new SessionCreateConsumerMessage(consumerID, queueName, filterString, browseOnly, true);
    SessionQueueQueryResponseMessage queueInfo = (SessionQueueQueryResponseMessage) getSessionChannel().sendBlocking(request, PacketImpl.SESS_QUEUEQUERY_RESP);
    return new ClientConsumerImpl(session, consumerContext, queueName, filterString, browseOnly, calcWindowSize(windowSize), ackBatchSize, maxRate > 0 ? new TokenBucketLimiterImpl(maxRate, false) : null, executor, flowControlExecutor, this, queueInfo.toQueueQuery(), lookupTCCL());
}
Also used : ClientConsumerImpl(org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl) ActiveMQConsumerContext(org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQConsumerContext) SessionQueueQueryResponseMessage(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage) TokenBucketLimiterImpl(org.apache.activemq.artemis.utils.TokenBucketLimiterImpl) SessionCreateConsumerMessage(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionCreateConsumerMessage)

Aggregations

ClientConsumerImpl (org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl)1 ActiveMQConsumerContext (org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQConsumerContext)1 SessionCreateConsumerMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionCreateConsumerMessage)1 SessionQueueQueryResponseMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage)1 TokenBucketLimiterImpl (org.apache.activemq.artemis.utils.TokenBucketLimiterImpl)1