camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kraythe ." <kray...@gmail.com>
Subject Re: I found a bug
Date Wed, 04 Jun 2014 15:06:31 GMT
To be clear the third route is superfluous to your argument.

Your argument is that auto-generated route IDs can use the same route ID as
an explicit route ID set to be the same as the auto-generated one.

You could propose the route builder core check if a route id is used before
generating a new ID. The reality is that it wouldn't know that another
route builder later wouldn't choose the same route ID it just picked. So if
you flip over the route build order, the builder would have to be
clairvoyant to know that later the user will use the given route id it just
picked. Furthermore that route using the same name could be in another
route builder completely. What is the core to do, tell you you cant use
that route ID? I suppose that is a possibility. The route builder could
throw an exception if you used an ID explicitly that is in use.

The Jira issues would be something like:

1) When route ID is not specified route builder core should auto-generate
guaranteed unique ID and make sure that ID is not already in use.
2) If a user sets an explicit route id, when the route is built, if that ID
is already used, the core should throw an exception at route construction
time.

Should be a small fix.

In the meantime .... don't do that. :)

*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
<http://www.linkedin.com/pub/robert-simmons/40/852/a39>*


On Thu, May 29, 2014 at 9:44 PM, Ernest Lu <syf_lx@sina.com> wrote:

> Hi,
>
> I have three RouteDefinitions,as follows.
>
> from("direct:start")
> .routeId("route1")
> .to("mock:end")
>
> from("direct:start2")
> .to("mock:end")
>
> from("jetty:http://0.0.0.0:15124/download")
> .removeHeader(Exchange.HTTP_URI)
> .routeId("filedownload")
> .to("http://127.0.0.1:8090/camel.doc")
>
> The first RouteDefinition specify  route ID("route1") and the second not,
> so the second RouteDefinition  will AUTO generate route id which same as
> the
> first RouteDefinition id.
>
> In third RouteDefinition,I want to download a file by http proxy,but the
> http response will lose file name.
>
> 我英语水平有点渣...
>
> 上面3个路由 第一个路由如果指定ID为"route1",第二个不指定ID,第二个就会生成名为'route1'的ID,和第一个重复了。
>
> 第三个路由 我想通过代理下载一个文件,但是下载的文件的名字和后缀名都丢失了,在message中的header里面也找不到文件名了,要怎么做.
>
>
> Thanks!
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/I-found-a-bug-tp5751728.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message