在处理器上设置不同的交换异常
我有这样的路线:
onException(classOf[RuntimeException]).process(runtimeProcessor).process(doSmth).log(LoggingLevel.INFO, "new", "${exchangeId} --- ${exception.stacktrace} ")
在处理器上我这样做:
CustomException customException =new CustomException ()
exchange.setException(customException )
exchange.getOut.setBody(doc)
现在的问题是,在这个处理器之后,它不会转到其他处理器(即在我的情况下,它不会转到“doSmth”处理器)
我猜这种行为是我已经更改了交换上的异常,我在其上构建了“onException”。
即使在更改了交易所的例外之后,有没有什么方法可以强制继续我的路线!
I have a route like that :
onException(classOf[RuntimeException]).process(runtimeProcessor).process(doSmth).log(LoggingLevel.INFO, "new", "${exchangeId} --- ${exception.stacktrace} ")
On the processor I do :
CustomException customException =new CustomException ()
exchange.setException(customException )
exchange.getOut.setBody(doc)
The issue now that after this processor , it doesn't go to other processors (i.e. in my case , it doesn't go to "doSmth" processor )
I guess that behavior is that I have changed the exception on the exchange that I have built my "onException" over it .
Is there any way to force to go on my route even after changing the Exchange's exception !!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我试图将进入交换的捕获的异常包装到另一个自定义异常中。
包装之后,我需要将此异常设置到自定义交换中。
后来我从camel论坛上的@Claus Ibsen-2那里发现Camel不会继续。当我使用路由时,
我已经设法通过执行以下@处理器来完成一些工作:
然后@Route:
它将以下内容打印到我的日志中,以及我从一开始就真正需要的内容:
自定义异常:java.lang.IOException
I was trying to wrap the caught exception that comes into the exchage and wrap it into another custom exception .
After this wrapping I need to set this exception into a custom exchange .
I have discoverd later from @Claus Ibsen-2 on the camel forum that Camel won't cont. routing when I use
I have managed to do some work around by doing the following @ processor :
then @Route :
It prints into my log the following and that what I exactly need from the beginning :
CustomException: java.lang.IOException