You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Gabriel Soto (JIRA)" <ji...@apache.org> on 2019/05/21 18:39:00 UTC
[jira] [Updated] (CAMEL-13554) Using "route1" as a route id
produces infinite loop
[ https://issues.apache.org/jira/browse/CAMEL-13554?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gabriel Soto updated CAMEL-13554:
---------------------------------
Description:
Steps:
# Start a Camel context.
# Add a route through RouteBuilder with id *"route1"* (reserved id).
# Attempt to add a second route. The method enters an infinite loop.
Example code that reproduces the problem:
{code:java}
package com.paytrue.swakka;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
public class InfLoopMain {
public static void main(final String[] args) throws Exception {
final DefaultCamelContext camelContext = new DefaultCamelContext();
camelContext.start();
final RouteBuilder route1 = new RouteBuilder() {
@Override
public void configure() {
from("direct:in1")
.id("route1") // Note the name
.to("mock:test1");
}
};
camelContext.addRoutes(route1);
final RouteBuilder route2 = new RouteBuilder() {
@Override
public void configure() {
from("direct:in2")
.to("mock:test2");
}
};
// Infinite loop
camelContext.addRoutes(route2);
}
}
{code}
was:
Steps:
# Start a camel context.
# Add a route through RouteBuilder with id "route1" (reserved id).
# Attempt to add a second route. The method enters an infinite loop.
Example code that reproduces the problem:
{code:java}
package com.paytrue.swakka;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
public class InfLoopMain {
public static void main(final String[] args) throws Exception {
final DefaultCamelContext camelContext = new DefaultCamelContext();
camelContext.start();
final RouteBuilder route1 = new RouteBuilder() {
@Override
public void configure() {
from("direct:in1")
.id("route1") // Note the name
.to("mock:test1");
}
};
camelContext.addRoutes(route1);
final RouteBuilder route2 = new RouteBuilder() {
@Override
public void configure() {
from("direct:in2")
.to("mock:test2");
}
};
// Infinite loop
camelContext.addRoutes(route2);
}
}
{code}
> Using "route1" as a route id produces infinite loop
> ---------------------------------------------------
>
> Key: CAMEL-13554
> URL: https://issues.apache.org/jira/browse/CAMEL-13554
> Project: Camel
> Issue Type: Improvement
> Components: came-core
> Affects Versions: 2.24.0
> Environment: JDK 8u121
> Camel 2.24.0
> Reporter: Gabriel Soto
> Priority: Minor
>
> Steps:
> # Start a Camel context.
> # Add a route through RouteBuilder with id *"route1"* (reserved id).
> # Attempt to add a second route. The method enters an infinite loop.
> Example code that reproduces the problem:
> {code:java}
> package com.paytrue.swakka;
> import org.apache.camel.builder.RouteBuilder;
> import org.apache.camel.impl.DefaultCamelContext;
> public class InfLoopMain {
> public static void main(final String[] args) throws Exception {
> final DefaultCamelContext camelContext = new DefaultCamelContext();
> camelContext.start();
> final RouteBuilder route1 = new RouteBuilder() {
> @Override
> public void configure() {
> from("direct:in1")
> .id("route1") // Note the name
> .to("mock:test1");
> }
> };
> camelContext.addRoutes(route1);
> final RouteBuilder route2 = new RouteBuilder() {
> @Override
> public void configure() {
> from("direct:in2")
> .to("mock:test2");
> }
> };
> // Infinite loop
> camelContext.addRoutes(route2);
> }
> }
> {code}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)