mirror of https://github.com/apache/activemq.git
[AMQ-6763] Add timeout on transport client to avoid blocking thread
This commit is contained in:
parent
fc2ad12e6b
commit
a0d740aac1
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue