Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camel-bridge-examples broken #411

Open
cdennison opened this issue Jan 13, 2021 · 1 comment
Open

camel-bridge-examples broken #411

cdennison opened this issue Jan 13, 2021 · 1 comment
Labels

Comments

@cdennison
Copy link

Questions

Camel example appears to be broken for both 3.x and 4.x

Version

3.x

31530f5

4.x

be4a5dd

Steps to reproduce

3.x

maven clean package

$ java -jar target/ run io.vertx.example.camel.rmi.RMIExample
camel-bridge-examples-3.9.0.jar maven-archiver/
classes/ maven-status/
generated-sources/ original-camel-bridge-examples-3.9.0.jar
C02Y75JAJGH5:camel-bridge-examples dennch3$ java -jar target/camel-bridge-examples-3.9.0.jar run io.vertx.example.camel.rmi.RMIExample
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Jan 13, 2021 10:56:36 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@20e8ccf0: startup date [Wed Jan 13 10:56:36 EST 2021]; root of context hierarchy
Jan 13, 2021 10:56:36 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/spring/camelContext.xml]
Jan 13, 2021 10:56:36 AM org.springframework.core.io.support.PropertiesLoaderSupport loadProperties
INFO: Loading properties file from class path resource [myapp.properties]
Jan 13, 2021 10:56:37 AM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
INFO: Succeeded in deploying verticle

$ curl http://localhost:8080/?name=world
No handlers for address invocation

4.x

$ java -jar target/camel-bridge-examples-4.0.0.jar run io.vertx.example.camel.rmi.RMIExample
Jan 13, 2021 11:03:22 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@50a55bad: startup date [Wed Jan 13 11:03:22 EST 2021]; root of context hierarchy
Jan 13, 2021 11:03:22 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/spring/camelContext.xml]
Jan 13, 2021 11:03:22 AM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
SEVERE: Failed in deploying verticle
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/spring/camelContext.xml]; nested exception is java.lang.NoClassDefFoundError: org/apache/camel/impl/DefaultCamelBeanPostProcessor

Extra

OSX, Java 1.8, Maven 3.6.3

@cdennison cdennison added the bug label Jan 13, 2021
@mattirn
Copy link

mattirn commented Jun 10, 2022

IMHO, camel-bridge is broken in vertx v4.x. The following does not work

    public void testCamelBridge() throws Exception {
        CamelContext camelContext = new DefaultCamelContext();
        camelContext.addRoutes(new RouteBuilder() {
            @Override
            public void configure() {
                from("direct:start").transform(constant("OK"));
            }
        });
        camelContext.start();

        VertxOptions vertxOptions = new VertxOptions();
        vertxOptions.setEventLoopPoolSize(4);
        vertxOptions.setWorkerPoolSize(4);
        Vertx vertx = Vertx.vertx(vertxOptions);
        CamelBridge bridge = CamelBridge.create(vertx, new CamelBridgeOptions(camelContext)
                .addOutboundMapping(OutboundMapping.fromVertx("test").toCamel("direct:start")));
        bridge.start();
        vertx.eventBus().request("test", "hello", reply -> LOG.info("reply.result().body():{}"
                , reply.result() != null ? reply.result().body() : "null"));

    }

Executing the method will trace INFO reply.result().body():null while when running in vertx v3.x (replace vertx.eventBus().request( ... ) with vertx.eventBus().send( ... )) it will trace INFO reply.result().body():OK as expected.

In vertx v4.x I'm having camel v3.x and vertx v3.x camel v2.x if that matters.

See, vert-x3/vertx-camel-bridge#48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants