- Instead of using broadcast/1, broadcast_request/1
is used and the message is only considered processed if broadcast_request/1
succeeds. If the message is handled with success, an
XACK
is sent to the server.
Options processed:
- block(+Seconds)
- Causes
XREADGROUP
to return with timeout when no messages arrive within Seconds. On a timeout, xidle_group/5 is called which will try to handle messages to other consumers pending longer than Seconds. Choosing the time depends on the application. Notably:- Using a time shorter than the required processing time will make the
job migrate from consumer to consumer until
max_deliveries(Count)
is exceeded. Note that the original receiver does not notice that the job is claimed and thus multiple consumers may ultimately answer the message. - Using a too long time causes an unnecessarily long delay if a node fails.
- Using a time shorter than the required processing time will make the
job migrate from consumer to consumer until
- max_deliveries(+Count)
- Re-deliver (using
XCLAIM
) a message max Count times. Exceeding this calls xhook/2. Default Count is3
. - max_claim(+Count)
- Do not claim more than Count messages during a single idle
action. Default is
10
.