diff --git a/core/src/main/scala/kafka/consumer/SimpleConsumer.scala b/core/src/main/scala/kafka/consumer/SimpleConsumer.scala index 58f77a3..6baf4c5 100644 --- a/core/src/main/scala/kafka/consumer/SimpleConsumer.scala +++ b/core/src/main/scala/kafka/consumer/SimpleConsumer.scala @@ -17,6 +17,9 @@ package kafka.consumer +import java.io.IOException +import java.nio.channels.ClosedByInterruptException + import kafka.api._ import kafka.network._ import kafka.utils._ @@ -78,6 +81,8 @@ class SimpleConsumer(val host: String, blockingChannel.send(request) response = blockingChannel.receive() } catch { + case e : ClosedByInterruptException => + throw new InterruptedException("interrupted while waiting for channel I/O") case e : Throwable => info("Reconnect due to socket error: %s".format(e.toString)) // retry once -- libgit2 0.21.2