OnCompletion() in Apache Camel is called more than once

心已入冬 提交于 2019-12-24 06:41:04

问题


In routeBuilder class it is having many routes, after completion of all routes need to call testMethod() but currently testMethod() method is calling many times

 .onCompletion().bean(TestProcessor.class,"testMethod").end()

//Router Class

     from(Source).setHeader("message", 

    body()).onCompletion().bean(TestProcessor.class,"testMethod").end().
    choice().when(header("camelfilenameonly").contains("test1.csv"))
   .unmarshal().bindy(BindyType.Csv,Test1CsvDto.class).bean(TestProcessor.class,
                        "processTest1Object").stop()

                .otherwise().choice()
                .when(header("camelfilenameonly").contains("test2.csv"))
                //Unmarshal csv
                .unmarshal().bindy(BindyType.Csv, Test2CsvDto.class).bean(TestProcessor.class,
                        "processTest2").stop()

any help would be appreciated..

来源:https://stackoverflow.com/questions/46237756/oncompletion-in-apache-camel-is-called-more-than-once

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!