You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by franktva <fr...@gmail.com> on 2015/04/04 17:43:27 UTC

Custom Load Balancing based on Inflight Exchange

I am attempting to write a Custom Load Balancing policy based on the number
of Inflight messages per Endpoint.  Basically, I want to return the
processor with the least number of Inflight messages.  I understand these
metrics are available as JMX attributes.  Is there a better approach than
reaching out to JMX to get these metrics within my Custom Load Balancer?



--
View this message in context: http://camel.465427.n5.nabble.com/Custom-Load-Balancing-based-on-Inflight-Exchange-tp5765328.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Custom Load Balancing based on Inflight Exchange

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah maybe we have a few different strategies already. But one based
on "pick first the ones who are doing no or the least amount of work"
sounds like a useable use-case.

So yeah you are welcome to get back when you have something working
and contribute. We love that
http://camel.apache.org/contributing.html

On Mon, Apr 6, 2015 at 1:52 PM, franktva <fr...@gmail.com> wrote:
> Thanks for the quick response.  That's the exact approach I'm taking.  Do you
> think this feature would be useful for a future release?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Custom-Load-Balancing-based-on-Inflight-Exchange-tp5765328p5765358.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Custom Load Balancing based on Inflight Exchange

Posted by franktva <fr...@gmail.com>.
Thanks for the quick response.  That's the exact approach I'm taking.  Do you
think this feature would be useful for a future release?



--
View this message in context: http://camel.465427.n5.nabble.com/Custom-Load-Balancing-based-on-Inflight-Exchange-tp5765328p5765358.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Custom Load Balancing based on Inflight Exchange

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Since you write a custom LB, then its likely much easier to use a
counter youself to keep track of how many are inflight on each of
those.

If you want to wait for the exchange to be done at the end, you can
use UoW to add a "work" where you can decrement the counter.

>From Camel 2.16 onwards you can also easier get the JMX stats without
doing JMX lookups, if you have the id of the processor. Then there is
getManagedProcessor API on CamelContext. And then you have type-safe
api to get the performance stats and whatnot.

        ManagedAggregateProcessorMBean client =
context.getManagedProcessor("myAggregator",
ManagedAggregateProcessorMBean.class);

On Sat, Apr 4, 2015 at 5:43 PM, franktva <fr...@gmail.com> wrote:
> I am attempting to write a Custom Load Balancing policy based on the number
> of Inflight messages per Endpoint.  Basically, I want to return the
> processor with the least number of Inflight messages.  I understand these
> metrics are available as JMX attributes.  Is there a better approach than
> reaching out to JMX to get these metrics within my Custom Load Balancer?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Custom-Load-Balancing-based-on-Inflight-Exchange-tp5765328.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/