-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is asynchronous nack thread blocking? #183
Comments
I don't think this is actually a problem - the real work is handled by op-rabbit/core/src/main/scala/com/spingo/op_rabbit/impl/AsyncAckingRabbitConsumer.scala Lines 79 to 82 in 9a681c4
which runs the work ( op-rabbit/core/src/main/scala/com/spingo/op_rabbit/impl/AsyncAckingRabbitConsumer.scala Lines 178 to 185 in 9a681c4
The recovery strategy in our application (presumably typical) is just I think this issue can probably be closed. |
To answer point 2, isn't it the case that if the body returns |
thank you @kw217 Right.
So the main concern does not exist. Though it would have been preferred an implementation without thread blocking at all. Regarding the 2nd point it would be nice if op-rabbit's RecoveryStrategy would be more flexible and allow the user to specify a reject with requeue = true/false as needed. Currently the user is forced to specify only one of them. |
We'd like to also have op-rabbit's thoughts on this. |
It looks like explicit
nack
can be used only synchronously and the only way to use it asynchronously is by supplying it as an implicit default RecoveryStrategy forBoundConsumerDefinition
(i.e. the subscription).So to consume some item asynchronously we should roughly use something like
ack(Future{ body_process_result})
. The doc says that if the future fails then the RecoveryStrategy is applied(i.e the wanted nack is called). But this leads toop-rabbit/core/src/main/scala/com/spingo/op_rabbit/impl/AsyncAckingRabbitConsumer.scala
Line 179 in ff9f8a2
Are there any plans to improve this?
And a 2nd question: Is there any other approach to use nack asynchronously besides the approach above(also used in /op-rabbit/core/src/test/scala/com/spingo/op_rabbit/consumerSpec.scala test) ?
The text was updated successfully, but these errors were encountered: