public class ConsumerRegistry extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
QUEUE_X_EXPIRY_MILLIS |
| Constructor and Description |
|---|
ConsumerRegistry(ConnectionHolder connectionHolder,
QueueConsumerFactory queueingService) |
| Modifier and Type | Method and Description |
|---|---|
QueueConsumer |
consumerPresto(String queueName)
Gets the registered consumer with the given queue name; creates a new one if none is registered so far, together with a new channel,
starts consuming from the queue name, and puts it into this registry.
|
void |
removeOldConsumers(long inactivityMillis) |
void |
unregister(QueueConsumer consumer)
Unregisters the consumer and close its channel.
|
public static final long QUEUE_X_EXPIRY_MILLIS
@Inject public ConsumerRegistry(ConnectionHolder connectionHolder, QueueConsumerFactory queueingService)
public void unregister(QueueConsumer consumer)
consumer - the consumer to unregister.IllegalStateException - if another consumer is stored in the registry under the passed in consumer's queue namepublic QueueConsumer consumerPresto(String queueName) throws IOException
The consumer will consume the queue in exclusive mode.
queueName - name of the queue the consumer listens onIOExceptionpublic void removeOldConsumers(long inactivityMillis)
Copyright © 2020 LeanIX GmbH. All rights reserved.