我想使用 Apache Camel 2.19.x 中的新连接器策略来使用 ReSTLet Producer 按计划连接到 JasperServer 实例以下载某些报告。
基本上我想做的是转换以下内容:-
from("timer://runOnce?repeatCount=1&delay=5000")
.setHeader(ReSTLetConstants.RESTLET_LOGIN).simple("jasperadmin") .setHeader(ReSTLetConstants.RESTLET_PASSWORD).simple("jasperadmin")
.to("reSTLet:http://localhost:8181/jasperserver/rest_v2/reports/reports/interactive/MapReport.pdf?reSTLetMethods=get").to("文件:C:/tmp/camel")
到
from("jasper-server").to("文件:C:/tmp/camel")
问题是 ReSTLetComponent 默认设置 ReSTLetConsumer,我不确定如何使用组件选项将其设置为生产者模式,或者我是否应该使用 SchedulerComponent 作为基础,然后以某种方式将 ReSTLet 功能集成到成分。使用 HttpComponent 作为基础组件会更好吗?
最佳答案
我还没有真正使用过 ReSTLetComponet,但我使用 http4 组件管理了与您类似的路线,例如:
from("timer://").to("direct:http-endpoint");
to("direct:http-endpoint").to("restlet://...")
我相信这就是Restlet Component docs中描述的内容
关于java - Apache Camel ReSTLet 生产者连接器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44694102/