0
我创建了一个应该从OPC-UA端点读取的路由。读操作应该每秒执行一次,基于计时器。我发现的每个例子都显示路线只能有一个from
项目。我的路线是这样的:如何创建基于计时器的骆驼轮询路线?
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route id="opctorest">
<from uri="timer://simpleTimer?period=1000"/>
<log message="Triggered Route: opctorest: Sensorreading body: ${body}"/>
<to uri="milo-client:tcp://0.0.0.0:4840/freeopcua/server?nodeId=2&namespaceUri=http://examples.freeopcua.github.io"/>
<convertBodyTo type="java.lang.String"/>
<to uri="stream:out"/>
</route>
</camelContext>
当我部署的路线,它被称为每一秒,但它写入到端点,因为该呼叫在to
元素声明。我怎样才能把它变成一个阅读?到目前为止我找不到解决方案。谢谢!
顺便说也有PollingEnrich这样你就可以查询端点和基于某些间隔读取。也许这更适合你? –
这样做的技巧,谢谢:) – Fluffy