public interface MQAppender<M extends Externalizable> extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
MQOffset |
append(int partition,
M message)
Append a message into a partition, returns
MQOffset position of the message. |
default MQOffset |
append(String key,
M message)
Same as
append(int, Externalizable) , the queue is chosen using a hash of . |
boolean |
closed()
Returns
true if the close has been closed. |
String |
name()
Returns the MQueue's name.
|
int |
size()
Returns the number of partitions.
|
boolean |
waitFor(MQOffset offset,
String group,
Duration timeout)
Wait for consumer to process a message up to the offset.
|
close
int size()
MQOffset append(int partition, M message)
MQOffset
position of the message.
This method is thread safe, a queue can be shared by multiple producers.partition
- index lower than size()
default MQOffset append(String key, M message)
append(int, Externalizable)
, the queue is chosen using a hash of .boolean waitFor(MQOffset offset, String group, Duration timeout) throws InterruptedException
true
if the message has been consumed, false
in case of timeout.InterruptedException
boolean closed()
true
if the close has been closed.Copyright © 2017 Nuxeo. All rights reserved.