camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Srinivas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-10277) "There are no outputs which matches: * in the route" when OnException is used in the Route with weaving
Date Wed, 07 Sep 2016 15:31:22 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-10277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15470931#comment-15470931
] 

Srinivas commented on CAMEL-10277:
----------------------------------

It worked when I use below code instead of weaveById.

{code:xml}
				interceptSendToEndpoint("mock:foo")
					.skipSendToOriginalEndpoint()
					.to("mock:out");
{code}

> "There are no outputs which matches: * in the route" when OnException is used in the
Route with weaving
> -------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-10277
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10277
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-blueprint, camel-test
>    Affects Versions: 2.16.2
>         Environment: Karaf, Camel
>            Reporter: Srinivas
>            Priority: Minor
>
> I have a route which is using onException. When I wrote a CBTS with weaving, test is
failing with the below exception. I could reproduce using a sample route. Please have a look:
> Exception received:
> {panel}
> java.lang.IllegalArgumentException: There are no outputs which matches: * in the route:
Route(foo)[[From[direct:start]] -> [OnException[[class java.lang.Exception] -> [SetHeader[error,
constant{true}], Stop]], pipeline -> [[To[mock://result], Stop]]]]
> {panel}
> Here is the Sample Route and Test class to reproduce.
> {code:xml}
> public class OnExceptionRouteIdTest extends CamelBlueprintTestSupport {
> 	private static final String START = "direct:start";
> 	@Override
> 	public boolean isUseAdviceWith() {
> 		return true;
> 	}
> 	@Override
> 	protected String getBlueprintDescriptor() {
> 		return "OSGI-INF/blueprint/success.xml";
> 	}
> 	@Override
> 	protected RouteBuilder createRouteBuilder() {
> 		return new OnExceptionRouteIdRouteBuilder();
> 	}
> 	@Override
> 	protected CamelContext createCamelContext() throws Exception {
> 		final CamelContext camelContext = super.createCamelContext();
> 		camelContext.setTracing(true);
> 		camelContext.addComponent("activemq", new StubComponent());
> 		return camelContext;
> 	}
> 	@Test
> 	public void testOnExceptionRouteId() throws Exception {
> 		final MockEndpoint end = getMockEndpoint("mock:result");
> 		context.getRouteDefinition("foo").adviceWith(context, new AdviceWithRouteBuilder()
{
> 			@Override
> 			public void configure() throws Exception {
> 				replaceFromWith(START);
> 				weaveById("toTestWeaving").replace().to(end).stop();
> 				weaveAddLast().to(end);
> 			}
> 		});
> 		context.start();
> 	}
> }
> public class OnExceptionRouteIdRouteBuilder extends RouteBuilder {
> 	@Override
> 	public void configure() throws Exception {
> 		onException(Exception.class).id("myError")
> 			.maximumRedeliveries(0)
> 			.handled(true)
> 			.setHeader("error", constant("true"))
> 			.end()
> 			.stop();
> 		from("direct:foo").routeId("foo")
> 			.to("mock:foo").id("toTestWeaving")
> 			.end();
> 	}
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message