在OPC-UA服务器上使用Apache Camel Connect接收数据

时间:2018-10-02 19:16:05

标签: apache-camel

我需要建立一个骆驼路由以连接到OPC-UA服务器中以接收数据。

尝试过:

public static void main(String[] args) throws Exception {
    CamelContext context = new DefaultCamelContext();

    context.addComponent("milo-client", new MiloClientComponent());

    context.addRoutes(new RouteBuilder() {

        @Override
        public void configure() throws Exception {
            from("milo-client:tcp://host:63500/OpcUa/Server")
            .log("${body}");
        }
    });
    context.start();
    System.out.println(context.getComponentNames()); 
    Thread.sleep(2000000);
    context.stop();
}

收到此错误:

java.util.concurrent.ExecutionException: UaException: status=Bad_Timeout, message=timed out waiting for acknowledge
at java.util.concurrent.CompletableFuture.reportGet(Unknown Source)
at java.util.concurrent.CompletableFuture.get(Unknown Source)
at org.apache.camel.component.milo.client.internal.SubscriptionManager.performConnect(SubscriptionManager.java:447)
at org.apache.camel.component.milo.client.internal.SubscriptionManager.performAndEvalConnect(SubscriptionManager.java:394)
at org.apache.camel.component.milo.client.internal.SubscriptionManager.connect(SubscriptionManager.java:389)
at org.apache.camel.component.milo.client.internal.SubscriptionManager.<init>(SubscriptionManager.java:359)
at org.apache.camel.component.milo.client.MiloClientConnection.init(MiloClientConnection.java:49)
at org.apache.camel.component.milo.client.MiloClientConnection.checkInit(MiloClientConnection.java:66)
at org.apache.camel.component.milo.client.MiloClientConnection.monitorValue(MiloClientConnection.java:83)
at org.apache.camel.component.milo.client.MiloClientConsumer.doStart(MiloClientConsumer.java:59)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:3705)
at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRouteConsumers(DefaultCamelContext.java:4023)
at org.apache.camel.impl.DefaultCamelContext.doStartRouteConsumers(DefaultCamelContext.java:3958)
at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3878)
at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3642)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3494)
at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:209)
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3253)
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3249)
at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3272)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3249)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3165)
at camel.OPC.main(OPC.java:23)

我试图找到更多有关此的示例,但没有成功。 我需要从具有TAG的系统中读取数据,也许我需要将TAG作为URL参数传递,但是我想尝试得到该错误无法解决端点。

0 个答案:

没有答案