public interface MQManager<M extends Externalizable> extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
boolean |
createIfNotExists(String name,
int size)
Creates a new MQueue with
size partitions if the MQueue does not exists. |
MQTailer<M> |
createTailer(String group,
Collection<MQPartition> partitions)
Create a tailer for a consumer
group and assign multiple partitions . |
MQTailer<M> |
createTailer(String group,
MQPartition partition)
Create a tailer for a consumer
group and assign a single partition . |
boolean |
delete(String name)
Try to delete a MQueue.
|
boolean |
exists(String name)
Returns
true if a MQueue with this name exists. |
MQAppender<M> |
getAppender(String name)
Get an appender for the MQueue named
name . |
MQTailer<M> |
subscribe(String group,
Collection<String> names,
MQRebalanceListener listener)
Create a tailer for a consumer
group and subscribe to multiple MQueues. |
boolean |
supportSubscribe()
Returns
true if the MQueue subscribe(java.lang.String, java.util.Collection<java.lang.String>, org.nuxeo.ecm.platform.importer.mqueues.mqueues.MQRebalanceListener) method is supported. |
close
boolean createIfNotExists(String name, int size)
size
partitions if the MQueue does not exists.
Returns true it the MQueue has been created.boolean delete(String name)
MQAppender<M> getAppender(String name)
name
.
An appender is thread safe.MQTailer<M> createTailer(String group, MQPartition partition)
group
and assign a single partition
.
A tailer is NOT thread safe.MQTailer<M> createTailer(String group, Collection<MQPartition> partitions)
group
and assign multiple partitions
.
A tailer is NOT thread safe.boolean supportSubscribe()
true
if the MQueue subscribe(java.lang.String, java.util.Collection<java.lang.String>, org.nuxeo.ecm.platform.importer.mqueues.mqueues.MQRebalanceListener)
method is supported.MQTailer<M> subscribe(String group, Collection<String> names, MQRebalanceListener listener)
group
and subscribe to multiple MQueues.
The partitions assignment is done dynamically depending on the number of subscribers.
The partitions can change during tailers life, this is called a rebalancing.
A listener can be used to be notified on assignment changes.
A tailer is NOT thread safe.
You should not mix createTailer(java.lang.String, org.nuxeo.ecm.platform.importer.mqueues.mqueues.MQPartition)
and subscribe
usage using the same group
.Copyright © 2017 Nuxeo. All rights reserved.