camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keegan Witt (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-11749) NoTypeConversionAvailableException in wiretap
Date Tue, 05 Sep 2017 18:57:00 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-11749?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Keegan Witt updated CAMEL-11749:
--------------------------------
    Description: 
# Clone https://github.com/apache/camel/tree/master/examples/camel-example-spring-boot
# Add _CamelLogger.java_ with contents below to _src/main/java/org/apache/camel/examples_

{code:title=Bar.java}
package org.apache.camel.examples;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.springframework.stereotype.Component;

@Component
public class CamelLogger implements Processor {
    @Override
    public void process(Exchange exchange) {
        System.err.println(exchange.getIn().getBody());
    }
}
{code}

  was:
As a workaround to CAMEL-11528, we tried replacing something like 
{code:java}
 from("direct:start")
    .wireTap("bean:tap")
    .to("mock:result");
{code}
 
with
{code:java}
from("direct:start")
    .wiretap("direct:tap")
    .to("mock:result");

from("direct:tap")
    .process("bean:tapper");
{code}

We got
{noformat}Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route
route190 at: >>> process[ref:bean:tapper] <<< in route: Route(route190)[[From[direct:tap]]
-> [OnException[[clas... because of No bean could be found in the registry for: bean:tapper
of type: org.apache.camel.Processor{noformat}

But if we did
{code:java}
public class MyRoute extends RouteBuilder {
    @Resource Tapper tapper;

    public void configure() throws Exception {
        from("direct:start")
            .wiretap("direct:tap")
            .to("mock:result");

        from("direct:tap")
            .process(tapper);
    }
}

@Component
public class Tapper implements Processor {
    public void Process(Exchange exchange) {}
}
{code}
It worked.


> NoTypeConversionAvailableException in wiretap
> ---------------------------------------------
>
>                 Key: CAMEL-11749
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11749
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.19.1
>            Reporter: Keegan Witt
>            Assignee: Claus Ibsen
>
> # Clone https://github.com/apache/camel/tree/master/examples/camel-example-spring-boot
> # Add _CamelLogger.java_ with contents below to _src/main/java/org/apache/camel/examples_
> {code:title=Bar.java}
> package org.apache.camel.examples;
> import org.apache.camel.Exchange;
> import org.apache.camel.Processor;
> import org.springframework.stereotype.Component;
> @Component
> public class CamelLogger implements Processor {
>     @Override
>     public void process(Exchange exchange) {
>         System.err.println(exchange.getIn().getBody());
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message