On Fri, Oct 23, 2009 at 1:55 PM, DulmerLucsly
<[email protected]> 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