MQueues.Tailer<M>
Constructor and Description |
---|
CQMQueues(File basePath)
Open an existing mqueues.
|
CQMQueues(File basePath,
int size)
Create a new mqueues.
|
Modifier and Type | Method and Description |
---|---|
CQOffset |
append(int queue,
M message)
Append a message into a queue, returns an
Offset . |
void |
close() |
MQueues.Tailer<M> |
createTailer(int queue)
Create a new
MQueues.Tailer associed with the queue index. |
MQueues.Tailer<M> |
createTailer(int queue,
String name)
Create a new
MQueues.Tailer associed to a queue index, using a specified offset name space. |
int |
size()
Returns the size of the mqueues: the number of queues.
|
boolean |
waitFor(Offset offset,
Duration timeout)
Wait for consumer to process a message up to the offset.
|
public CQMQueues(File basePath, int size)
public int size()
MQueues
public CQOffset append(int queue, M message)
MQueues
Offset
.
This method is thread safe, a queue can be shared by multiple producers.append
in interface MQueues<M extends Message>
queue
- index lower than MQueues.size()
public MQueues.Tailer<M> createTailer(int queue)
MQueues
MQueues.Tailer
associed with the queue index.
The committed offset is presisted in the default namespace.
There can be one and only one consumer for queue in a namespace.
A tailer is not thread safe.createTailer
in interface MQueues<M extends Message>
public MQueues.Tailer<M> createTailer(int queue, String name)
MQueues
MQueues.Tailer
associed to a queue index, using a specified offset name space.
The committed offset position is shared by all tailers of the same queue with the same name.
There can be one and only one consumer for queue in a namespace
A tailer is not thread safe.createTailer
in interface MQueues<M extends Message>
public boolean waitFor(Offset offset, Duration timeout) throws InterruptedException
MQueues
waitFor
in interface MQueues<M extends Message>
InterruptedException
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2017 Nuxeo. All rights reserved.