The load balancer example is doing request/reply messaging (aka MessageExchangePattern (MEP) = InOut) http://camel.apache.org/request-reply.html
The mina endpoint on the "other side" is configured with sync=true, which tells the Mina consumer that a reply message should be sent back, which is the message when the Camel route is "done". I suggest you learn about more background about Apache Camel such as reading this article http://java.dzone.com/articles/open-source-integration-apache And then you can take a look at some of the Enterprise Integration Patterns (EIP)s that Camel offers http://camel.apache.org/eip .. for example the event message vs request/reply, and the load balancer eip. And then look at the mina component as that is used in the example http://camel.apache.org/mina And there is also many 3rd party articles and blogs that can introduce you to Camel or talk about specific use-cases http://camel.apache.org/articles And if you want to go more hard-core with Camel then consider some of these books http://camel.apache.org/books ... and later this year a 4th Camel book hit the market http://www.packtpub.com/apache-camel-developers-cookbook/book On Mon, Nov 4, 2013 at 12:10 PM, pmp.martins <[email protected]> wrote: > I already modifed the example and it now works a little bit like the request > made HERE > <http://camel.465427.n5.nabble.com/Basic-Apache-Camel-LoadBalancer-Failover-Example-td5742551.html> > . > > However, I still don't understand how the loadbalancer is getting the > replies. Yes, it does send the report to the direct:loadbalance URI, but > then it picks it up and sends it to the MINA servers: > > <route id="loadbalancer"> > <from uri="direct:loadbalance" /> > <loadBalance inheritErrorHandler="false"> > <failover /> > <to uri="mina:tcp://localhost:9991?sync=true" > /> > <to uri="mina:tcp://localhost:9992?sync=true" > /> > </loadBalance> > <log message="${body}" /> > </route> > > In the MINA server's code, the servers are not explicitly sending anything > to the loadbalancer. > And in the loadbalancer, the only thing that is done is using the failvoer > construct. > > There is not one single place in the code, where I actually see explicitly > what is going on, and to me, this is quite confusing. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Load-balancing-using-Mina-example-with-Java-DSL-tp5742566p5742585.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
