Apache camel 使用Camel将ServiceMix 3.0升级到ServiceMix 6.0

Apache camel 使用Camel将ServiceMix 3.0升级到ServiceMix 6.0,apache-camel,apache-servicemix,Apache Camel,Apache Servicemix,我已经使用带有JBI消息传递的ServiceMix 3.0创建了一个基于java的小应用程序。 应用程序工作时,我们使用filepoller读取一个文件位置(每5分钟一次),并将文件转换为另一种格式,即从.xml转换为pdf 我们使用Servicmix filewriter组件在其他文件位置写入的输出文件 CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder()

我已经使用带有JBI消息传递的ServiceMix 3.0创建了一个基于java的小应用程序。

应用程序工作时,我们使用filepoller读取一个文件位置(每5分钟一次),并将文件转换为另一种格式,即从.xml转换为pdf

我们使用Servicmix filewriter组件在其他文件位置写入的输出文件

    CamelContext context = new DefaultCamelContext();

    context.addRoutes(new RouteBuilder() {
        public void configure() throws Exception {
            from("timer://foo?period=1000").process(new Processor() {
                @Override
                public void process(Exchange exchange) throws Exception {
                    System.out.println("Hello world  :"
                            + new java.util.Date().toString());
                }
            });
        }

    });
    context.start();
    Thread.sleep(10000);
    context.stop();
现在我们需要升级ApacheServiceMix 6.0和Camel 2.15.2

我是阿帕奇骆驼队的新手。我在servicemix 6.0和camel 2.15.2上做了一些POC工作,但并没有完全了解如何实现我们的应用场景

POC的工作方式类似于使用文件、计时器、调度程序和组件

    CamelContext context = new DefaultCamelContext();

    context.addRoutes(new RouteBuilder() {
        public void configure() throws Exception {
            from("timer://foo?period=1000").process(new Processor() {
                @Override
                public void process(Exchange exchange) throws Exception {
                    System.out.println("Hello world  :"
                            + new java.util.Date().toString());
                }
            });
        }

    });
    context.start();
    Thread.sleep(10000);
    context.stop();
任何人都可以帮助实现上述场景

请大家提出一些其他的方法来获得这个场景


提前谢谢

对于读取的文件,可以使用
文件
()组件。对于写入文件,您也可以使用
文件
组件。
我对您的文件格式一无所知,因此无法对其处理提出任何建议

对于处理,您可以使用以下组件:

xslt
(转换XML)

fop
(转换为PDF)

velocity
(通过模板转换为XML)等

或者您可以使用一些数据格式:如BeanIO()

例如:

    from("file://inbox?sortBy=file:name&include=(.*[.](xml|XML)$)&delete=true&preMove=inprogress&delay=300000"). 
     //5 min. delay between poll, consuming only xml file
      routeId("testRoute")
    .to("xslt:xsl/transform.xsl") //refers to the file xsl/transform.xsl on the classpath
     //....... some other transformation here .......
    .to("file://outbox");