You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If on consumer.receive we get a failed Try does one need to call consumer.negativeAcknowledge?
If so then how does one do this as we would only have the exception and not the consumer method?
For example. with code below what would we reference in consumer.negativeAcknowledge(??) as msg is Try[CosumerMessage[String]]
val msg = consumer.receive
msg match {
case Success(value) =>
println(s"${consumer.subscription} Success, $label ${value.valueTry}")
consumer.acknowledge(value)
case Failure(exception) =>
println(s"Failed: ${exception.getMessage}")
consumer.negativeAcknowledge(??)
}
The text was updated successfully, but these errors were encountered:
Are you encountering a situation where failures lead to unacknowledged messages? If so that's likely a bug.
If you don't receive a message back that typically means there was an error receiving the message for some reason (e.g. the client is disconnected or closed). It's not your responsibility to acknowledge anything. The correct way to recover really depends on the type of error, but one possible strategy is to restart the consumer with an exponential backoff, then fail after some amount of time.
If on consumer.receive we get a failed Try does one need to call consumer.negativeAcknowledge?
If so then how does one do this as we would only have the exception and not the consumer method?
For example. with code below what would we reference in consumer.negativeAcknowledge(??) as msg is
Try[CosumerMessage[String]]
The text was updated successfully, but these errors were encountered: