Just looking for feedback on how best to implement this. This changes the sender and receiver methods.
The change to sender method is that it now has a :fanout option. This has 2 effects when set to true:
The exchange is declared as fanout
no queue is bound to the exchange
The change to receiver is that it supports 2 new options. :fanout and :queue_append. When:
:fanout is true but no queue_append is set: This is basically pubsub as the queue name is random and not durable and is auto_delete
:fanout is true and queue_append is set: This means that once the queue is is bound to the exchange it is forever bound and thus will be kept even when agents are restarted. This leaves the responsibility of using a consistent name up to the receiving agent. Thus if you want to run 2 of the same agent that are round robining the messages then that agent just needs to consistently name the queue_append.
Just looking for feedback on how best to implement this. This changes the
sender
andreceiver
methods.The change to
sender
method is that it now has a:fanout
option. This has 2 effects when set to true:The change to
receiver
is that it supports 2 new options.:fanout
and:queue_append
. When::fanout
istrue
but noqueue_append
is set: This is basically pubsub as the queue name is random and not durable and is auto_delete:fanout
istrue
andqueue_append
is set: This means that once the queue is is bound to the exchange it is forever bound and thus will be kept even when agents are restarted. This leaves the responsibility of using a consistent name up to the receiving agent. Thus if you want to run 2 of the same agent that are round robining the messages then that agent just needs to consistently name thequeue_append
.