|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.netflix.curator.framework.recipes.queue.DistributedQueue<T>
public class DistributedQueue<T>
An implementation of the Distributed Queue ZK recipe. Items put into the queue are guaranteed to be ordered (by means of ZK's PERSISTENT_SEQUENTIAL node).
Guarantees:
LeaderSelector to nominate a single consumer.QueueBuilder.lockPath(String) is used, there is only guaranteed processing of each message to the point of receipt by a given instance.
If an instance receives an item from the queue but dies while processing it, the item will be lost. If you need message recoverability, use
a QueueBuilder.lockPath(String)
| Method Summary | |
|---|---|
void |
close()
|
boolean |
flushPuts(long waitTime,
TimeUnit timeUnit)
Wait until any pending puts are committed |
void |
put(T item)
Add an item into the queue. |
void |
putMulti(MultiItem<T> items)
Add a set of items into the queue. |
void |
setErrorMode(ErrorMode newErrorMode)
Used when the queue is created with a QueueBuilder.lockPath(String). |
void |
start()
Start the queue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void start()
throws Exception
Exception - startup errorspublic void setErrorMode(ErrorMode newErrorMode)
QueueBuilder.lockPath(String). Determines
the behavior when the queue consumer throws an exception
newErrorMode - the new error mode (the default is ErrorMode.REQUEUE
public boolean flushPuts(long waitTime,
TimeUnit timeUnit)
throws InterruptedException
waitTime - max wait timetimeUnit - time unit
InterruptedException - if thread was interrupted
public void close()
throws IOException
close in interface CloseableIOException
public void put(T item)
throws Exception
item - item to add
Exception - connection issues
public void putMulti(MultiItem<T> items)
throws Exception
items - items to add
Exception - connection issues
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||