You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Carlo Camerino <ca...@gmail.com> on 2009/08/04 09:34:00 UTC

Questions On JMX And Load Balancing

Hi,

I have this route which is load balanced to three activemq queueues. At
runtime, i wish to disable for example the round robin load balancer from
sending to
activemq:c. Can I do this via JMX? I tried on killing routes but I get an
exception saying that it's not supported.....

Here is an example of a route that I use. Thanks A Lot

from("activemq:financials").loadBalance().roundRobin().to("activemq:a",
"activemq:b", "activemq:c");//process(jposProcessor);
        from("activemq:a").process(new Processor()  {

            public void process(Exchange arg0) throws Exception {
                logger.info("A");

            }
        });
        from("activemq:b").process(new Processor()  {

                    public void process(Exchange arg0) throws Exception {
                        // TODO Auto-generated method stub
                        logger.info("B");
                    }
                });
        from("activemq:c").process(new Processor()  {

            public void process(Exchange arg0) throws Exception {
                // TODO Auto-generated method stub
                logger.info("C");
            }
        });

    }

Re: Questions On JMX And Load Balancing

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

Yeah JMX is slated for an overhaul in 2.1.

It would be nice to get more JMX control for various DSL types such as
load balancers, delayers, throttlers, and whatnot.

You may be able to use the navigate API in 2.0 to lookup the load
balancer processor and manipulate it directly to remove the processor
you do not want.

        Navigate<Processor> nav = context.getRoutes().get(0).navigate();

This is a very early API and its a bit coarse grained to use, but it
does allow you to traverse the runtime route path and manipulate the
processors directly.


On Tue, Aug 4, 2009 at 10:17 AM, Willem Jiang<wi...@gmail.com> wrote:
> Hi
>
> Camel 1.x doesn't support the change the route dynamically.
> Camel 2.0 supports to modify the route dynamically.
> But for your requirement, I don't think current Camel 2.0 snapshot supports
> this found , since we don't export the load balancer's processor to the JMX.
> We have plan to do some enhancements[1][2] of the JMX support after Camel
> 2.0 release, please feel free to add your requirements.
>
> [1] http://issues.apache.org/activemq/browse/CAMEL-1266
> [2] http://issues.apache.org/activemq/browse/CAMEL-1484
>
> Willem
>
>
> Carlo Camerino wrote:
>>
>> Hi,
>>
>> I have this route which is load balanced to three activemq queueues. At
>> runtime, i wish to disable for example the round robin load balancer from
>> sending to
>> activemq:c. Can I do this via JMX? I tried on killing routes but I get an
>> exception saying that it's not supported.....
>>
>> Here is an example of a route that I use. Thanks A Lot
>>
>> from("activemq:financials").loadBalance().roundRobin().to("activemq:a",
>> "activemq:b", "activemq:c");//process(jposProcessor);
>>        from("activemq:a").process(new Processor()  {
>>
>>            public void process(Exchange arg0) throws Exception {
>>                logger.info("A");
>>
>>            }
>>        });
>>        from("activemq:b").process(new Processor()  {
>>
>>                    public void process(Exchange arg0) throws Exception {
>>                        // TODO Auto-generated method stub
>>                        logger.info("B");
>>                    }
>>                });
>>        from("activemq:c").process(new Processor()  {
>>
>>            public void process(Exchange arg0) throws Exception {
>>                // TODO Auto-generated method stub
>>                logger.info("C");
>>            }
>>        });
>>
>>    }
>>
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Questions On JMX And Load Balancing

Posted by Willem Jiang <wi...@gmail.com>.
Hi

Camel 1.x doesn't support the change the route dynamically.
Camel 2.0 supports to modify the route dynamically.
But for your requirement, I don't think current Camel 2.0 snapshot 
supports this found , since we don't export the load balancer's 
processor to the JMX.
We have plan to do some enhancements[1][2] of the JMX support after 
Camel 2.0 release, please feel free to add your requirements.

[1] http://issues.apache.org/activemq/browse/CAMEL-1266
[2] http://issues.apache.org/activemq/browse/CAMEL-1484

Willem


Carlo Camerino wrote:
> Hi,
> 
> I have this route which is load balanced to three activemq queueues. At
> runtime, i wish to disable for example the round robin load balancer from
> sending to
> activemq:c. Can I do this via JMX? I tried on killing routes but I get an
> exception saying that it's not supported.....
> 
> Here is an example of a route that I use. Thanks A Lot
> 
> from("activemq:financials").loadBalance().roundRobin().to("activemq:a",
> "activemq:b", "activemq:c");//process(jposProcessor);
>         from("activemq:a").process(new Processor()  {
> 
>             public void process(Exchange arg0) throws Exception {
>                 logger.info("A");
> 
>             }
>         });
>         from("activemq:b").process(new Processor()  {
> 
>                     public void process(Exchange arg0) throws Exception {
>                         // TODO Auto-generated method stub
>                         logger.info("B");
>                     }
>                 });
>         from("activemq:c").process(new Processor()  {
> 
>             public void process(Exchange arg0) throws Exception {
>                 // TODO Auto-generated method stub
>                 logger.info("C");
>             }
>         });
> 
>     }
>