For one of our customer, I have already used Future with an Executor in a SU POJO to realize concurrent service invocations.
It's not a great idea because few Futures are never terminated. We does not found why.
Thus, as a Future is not terminated, a thread of the Executor service is used. After some time, no more thread is available in the executor service (all are used by phatom Future) and the component or the Petals node must be restarted.
Another solution may be to have a method in the JBIContext to send asynchronously one message and specify the reply processing callback:
JBIContext.getMessageSender().sendAsync(exchange, new ExchangeCallback() {
@Override
public void onAsyncReply(Exchange exchange) {
...
}
@Override
public void onExpiredAsyncReply(Exchange exchange) {
...
}
})
For one of our customer, I have already used Future with an Executor in a SU POJO to realize concurrent service invocations.
It's not a great idea because few Futures are never terminated. We does not found why.
Thus, as a Future is not terminated, a thread of the Executor service is used. After some time, no more thread is available in the executor service (all are used by phatom Future) and the component or the Petals node must be restarted.
Another solution may be to have a method in the JBIContext to send asynchronously one message and specify the reply processing callback: