问题
I am trying to replace the CRLF of the input data with LF but this is breaking the route. My code is as shown below
from(fromEndpoint)
.convertBodyTo(byte[].class, "iso-8859-1")
.setBody(simple("body.replaceAll(\r\n, \n)"))....
if I take the setbody out it works perfect. I just want platform dependent line feeds
Any ideas what I am doing wrong?
Thanks
回答1:
solved with this
from(fromEndpoint)
.convertBodyTo(byte[].class, "iso-8859-1")
.setBody(body().regexReplaceAll("\\r\\n", "\\\n"))
来源:https://stackoverflow.com/questions/18508716/camel-replace-all-crlf-with-lf-using-simple-dsl