我从JMS队列(带有边界)接收到多部分消息,如何使用Camel将该消息转发到REST服务?我需要使用XML配置路由。 当我尝试路由邮件时,出现400错误。这似乎与边界有关,因为当我设置了错误的边界时,REST服务将收到消息(但无法解析它,导致虚假边界)。 我需要使用正确的边界转发消息,我尝试从正文中提取边界,这似乎是正确的,但是我收到了400错误。
<route id="testMultipart">
<from uri="activemq:queue:myqueue"/>
<setHeader
headerName="Content-Type"><simple>multipart/mixed; boundary=${body.replaceAll("(\--.*?\--)","$1").replaceAll("(\--)","")}</simple></setHeader>
<setHeader headerName="CamelHttpMethod">
<constant>POST</constant>
</setHeader>
<log message="Got body ${body}"/>
<to uri="https4://myendpoint?sslContextParametersRef=mySSLContextParameters"/>
</route>
主体正常,是带有边界的标准多部分混合消息。 有任何想法吗? 谢谢