|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapportive.storm.amqp.ExclusiveQueueWithBinding
public class ExclusiveQueueWithBinding
Declares an exclusive, server-named queue and binds it to an existing
exchange. This is probably the easiest way to start prototyping with an
AMQPSpout: if your app already publishes
to an exchange, you can just point this at the exchange and start consuming
messages.
However N.B. this queue setup is not reliable, in that if the spout task crashes or restarts, messages published while the spout is down will be lost (because the spout creates the queue when it starts up, and the server deletes the queue when the spout closes).
It also cannot scale out to multiple parallel spout tasks. The semantics of an exclusive queue mean that each spout task would get its own queue bound to the exchange. That means each task would receive a copy of every message, so messages would get processed multiple times.
If you need guaranteed processing or a horizontally scalable spout,
consider SharedQueueWithBinding.
| Constructor Summary | |
|---|---|
ExclusiveQueueWithBinding(String exchange,
String routingKey)
Create a declaration of an exclusive server-named queue bound to the specified exchange. |
|
| Method Summary | |
|---|---|
com.rabbitmq.client.AMQP.Queue.DeclareOk |
declare(com.rabbitmq.client.Channel channel)
Verifies the exchange exists, creates an exclusive, server-named queue and binds it to the exchange. |
boolean |
isParallelConsumable()
Returns false as this queue is not safe for parallel consumers. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExclusiveQueueWithBinding(String exchange,
String routingKey)
exchange - exchange to bind the queue to.routingKey - routing key for the exchange binding. Use "#" to
receive all messages published to the exchange.| Method Detail |
|---|
public com.rabbitmq.client.AMQP.Queue.DeclareOk declare(com.rabbitmq.client.Channel channel)
throws IOException
declare in interface QueueDeclarationchannel - An open AMQP channel which can be used to send the
declarations.
IOException - if the exchange does not exist, or if the AMQP
connection drops.public boolean isParallelConsumable()
isParallelConsumable in interface QueueDeclaration
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||