骆驼示例找不到org.apache.camel.impl.DefaultComponent

时间:2019-03-23 13:46:43

标签: java spring-boot apache-camel

我创建了一个小的Apache Camel示例,但是找不到类org.apache.camel.impl.DefaultComponentHere完整的错误日志。

我在search.maven.org上查找了该类,它表示该类应包含在org.apache.camel:camel-core中。添加它不能解决我的问题。 在这个例子中怎么了?


这是应用程序

@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(Application.class);
        app.setWebApplicationType(WebApplicationType.NONE);
        app.run(args);
    }
}

和这里的路线。

@Component
public class ZmqRoute extends RouteBuilder {

    @Override
    public void configure() throws Exception {
        //from("stream:in").to("stream:out");

        String host = "zmq.devnet.iota.org";
        from("zeromq:tcp://" + host + ":5556?socketType=SUBSCRIBE&topics=tx")
                .to("stream:out")
                .log("${body}");
    }
}

最后,这里是build.gradle.kts

plugins {
    java
    application
    id("org.springframework.boot") version "2.1.2.RELEASE"
    id("io.spring.dependency-management") version "1.0.6.RELEASE"
}

repositories {
    jcenter()
}

application {
    mainClassName = "org.example.camel.Application"
}

java {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType<JavaCompile>().configureEach {
    options.compilerArgs.addAll(arrayOf("-Xlint:all"))
    options.encoding = "UTF-8"
}

dependencies {
    val camelVersion = "3.0.0-M1"

    implementation("org.springframework.boot:spring-boot-starter-web")

    implementation("org.apache.camel:camel-spring-boot-starter:$camelVersion")

    implementation("org.apache.camel:camel-stream-starter:$camelVersion")

    //implementation("org.apache.camel:camel-core:$camelVersion")

    implementation("org.apache-extras.camel-extra:camel-zeromq:2.22.0") {
        exclude(module = "zeromq-scala-binding_2.10")
    }

    implementation("org.zeromq:jeromq:0.5.0")

    testImplementation("junit:junit:4.12")
}

2 个答案:

答案 0 :(得分:2)

因此,基本上,在查看Camel Core { "8": [ { "global_dag_conf": { "algo_v2_conf": { "features_to_combine": [], "segments": [], "force_performance": false, "min_bid": 0, "max_bid": 13 } }, "algo_id": 1 } ], "13": [ { "global_dag_conf": { "algo_v2_conf": { "ivr_measured": [] } }, "algo_id": 2 } ] } 之后,我发现了result = _.map(_.keys(addtionalAlgos), (algoType) => { addtionalAlgos[algoType] = _.map(addtionalAlgos[algoType], v => _.assign(v.config, { algo_id: v.id })); return addtionalAlgos; })[0] 文件

3.0.0.M1

不再存在!

.class

enter image description here

老实说,这对我来说似乎是个错误,或者与org.apache.camel.impl.DefaultComponent 不兼容。

答案 1 :(得分:0)