camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: RouteBuilder: Problems with onException and id
Date Mon, 26 Oct 2009 08:49:20 GMT
On Mon, Oct 26, 2009 at 9:20 AM, DRy <dirk.rybinski@itellium.de> wrote:
>
> Hi,
>
> having a user defined id is very important if you plan to use JMX-based
> administration (done by non-developers "dummies") for your application (as
> I/we do). We must be able to identify and start/stop routes via call to JMX
> or JConsole.
>
> I would prefer the "route(...)" solution ... but does that means that you
> have to start every route this way? Will this be mandatory .. ?
No only if you want to specify the route id you need to do this extra

route("myCoolRoute").from("xxx")....


>
> Is there a way to fix (or workaround) this problem asap ... ?
>

The Spring DSL works with route id

Using the Camel API you should be able to patch this from Java DSL.
Give me some time to check upon it, working on another ticket at this moment.

But could you create a JIRA ticket for this issue? Then we wont forget
and can have it in 2.1


>
>
> Claus Ibsen-2 wrote:
>>
>> On Fri, Oct 23, 2009 at 1:55 PM, DulmerLucsly
>> <dulmer.lucsly.nabble@quantentunnel.de> wrote:
>>>
>>> Hi erverybody,
>>>
>>> i have a little problem with exceptionhandling.
>>> Since i'm new to activeMq/Camel sorry if the question is trivial...
>>>
>>> I try to build a route with java DSL. My route looks like this:
>>>
>>> ....
>>> public void configure() {
>>>
>>> from("jms:fileIn?transacted=true")
>>>  .onException(UnmarshalException.class)
>>>   .handled(true)
>>>    .bean(FileProcessExceptionBean.class,"handleException")
>>> .end()
>>> .id("fileMapping")
>>> .transacted()
>>> .process(new FileProcessor())
>>> .to("jms:fileOut");
>>>
>>> }
>>>
>>> My problem is that in jConsole my Route is labeled "Route1" ( resp.
>>> Route2,
>>> Route3 etc).
>>> When i remove the onExecption-section my route gets labeled correctly
>>> like
>>> with .id() specified.
>>> When I move the onException-section to after .transcated(true) then the
>>> route gets labeled correctly, but the onException-section will ALWAYS be
>>> run, even if there was no Exception thrown.
>>>
>>> Any ideas ?
>>>
>>
>> Yeah the ID has not really had much attention. In Spring XML its not a
>> problem as its the id attribute on the XML tag itself.
>> However in Java DSL its a method call and the java language is not
>> well suited for DSL like syntax.
>>
>> I wonder if we should either force people to use
>> route("myRouteId).from(xxxx)...
>>
>> Or offer an option on the from endpoint, something like routeId
>> from("xxxx?routeId=myCoolRoute").onException()....
>>
>> The latter have the advantage at it works with multiple from's
>>
>>
>>
>>
>>> GeneralInfo:
>>> Apache Camel 2.1-SNAPSHOT (build 20091022) , Java 1.6.0,  Linux
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/RouteBuilder%3A-Problems-with-onException-and-id-tp26024958p26024958.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: http://www.nabble.com/RouteBuilder%3A-Problems-with-onException-and-id-tp26024958p26055883.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message