Skip to content

Commit

Permalink
Don't handle TimeoutException if processTimeout is disabled (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
jendakol authored Dec 13, 2018
1 parent 3e7908a commit f374e54
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -523,16 +523,18 @@ private[rabbitmq] object DefaultRabbitMQClientFactory extends LazyLogging {
val timedOutAction = if (processTimeout == Duration.ZERO) {
action
} else {
action.timeout(ScalaDuration(processTimeout.toMillis, TimeUnit.MILLISECONDS))
action
.timeout(ScalaDuration(processTimeout.toMillis, TimeUnit.MILLISECONDS))
.onErrorRecoverWith {
case e: TimeoutException =>
timeoutsMeter.mark()
logger.warn(s"[$name] Task timed-out, applying DeliveryResult.${consumerConfig.timeoutAction}", e)
Task.now(consumerConfig.timeoutAction)
}
}

timedOutAction
.onErrorRecoverWith {
case e: TimeoutException =>
timeoutsMeter.mark()
logger.warn(s"[$name] Task timed-out, applying DeliveryResult.${consumerConfig.timeoutAction}", e)
Task.now(consumerConfig.timeoutAction)

case NonFatal(e) =>
fatalFailuresMeter.mark()
logger.warn(s"[$name] Error while executing callback, applying DeliveryResult.${consumerConfig.failureAction}", e)
Expand Down

0 comments on commit f374e54

Please sign in to comment.