diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/FutureResponse.java b/activemq-client/src/main/java/org/apache/activemq/transport/FutureResponse.java index ff95869943..ff9328b3cf 100644 --- a/activemq-client/src/main/java/org/apache/activemq/transport/FutureResponse.java +++ b/activemq-client/src/main/java/org/apache/activemq/transport/FutureResponse.java @@ -42,10 +42,11 @@ public class FutureResponse { this.transportFilter = transportFilter; } + public Response getResult() throws IOException { boolean hasInterruptPending = Thread.interrupted(); try { - return responseSlot.take(); + return responseSlot.poll(2, TimeUnit.MINUTES); } catch (InterruptedException e) { hasInterruptPending = false; throw dealWithInterrupt(e);