camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From _Jens <>
Subject No connection reuse with recipientList and Mina Endpoints
Date Wed, 31 Mar 2010 07:46:55 GMT


I have run into an issue with a .recipientList() using Mina endpoints (Camel
2.1). Basically, I was changing a route from using static .to() calls into a
more dynamic .recipientList() call. With the .to() calls IoSessions were
reused to send data. However, with the .recipientList() it seems that the
IoSessions are created for each message. They are not closed immediately
after sending the message, but are held for quite some time. In the end our
server side refused additional connections until a timeout occurred and the
sessions were closed.

The reason for this seems to be the way that the recipient list retrieves
producers from the producer cache. From the source code of

        while (iter.hasNext()) {
            Object recipient =;
            Endpoint endpoint = resolveEndpoint(exchange, recipient);
            Producer producer =

There is a comment in ProducerCache.getProducer that says the producer pool
is not used because it cannot be guaranteed that the producer is returned to
the pool.
I changed our implementation back to using .choice() and .to() calls. But it
would be nice to have the recipient list functionality with Mina endpoints.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message