Apache camel 驼峰XSLT消息路由问题

Apache camel 驼峰XSLT消息路由问题,apache-camel,Apache Camel,我正在从队列->使用xslt转换消息,并将其转发到另一个队列log 我的驼峰配置如下: <camelContext xmlns="http://camel.apache.org/schema/spring" streamCache="true"> <route> <from uri="jms:queue:TradeEventsToESBQueue" /> <multicast>

我正在从队列->使用xslt转换消息,并将其转发到另一个队列log

我的驼峰配置如下:

<camelContext xmlns="http://camel.apache.org/schema/spring"
    streamCache="true">
    <route>
        <from uri="jms:queue:TradeEventsToESBQueue" />
        <multicast>
            <to uri="xslt:com/tpt/esb/tradeevent/confirmation.xsl" />
            <to uri="xslt:com/tpt/esb/tradeevent/valuation.xsl" />
        </multicast>
    </route>

    <route>
        <from uri="xslt:com/tpt/esb/tradeevent/confirmation.xsl" />
        <to uri="log:output?showAll=true" />
    </route>

    <route>
        <from uri="xslt:com/tpt/esb/tradeevent/valuation.xsl" />
        <to uri="jms:queue:TradeValuationStartQueue1?jmsMessageType=Text" />
        <to uri="log:output?showAll=true" />
    </route>
</camelContext>

运行该程序时,我遇到以下错误:

原因:org.apache.camel.ExpectedBodyTypeException:无法 在消息正文中提取类型:interface javax.xml.transform.Source 正文为:在 org.apache.camel.builder.xml.XsltBuilder.getSource(XsltBuilder.java:482)[64:org.apache.camel.camel核心:2.10.1] 在 org.apache.camel.builder.xml.XsltBuilder.process(XsltBuilder.java:125)[64:org.apache.camel.camel核心:2.10.1] 在 org.apache.camel.impl.ProcessorPollingConsumer.receive(ProcessorPollingConsumer.java:58)[64:org.apache.camel.camel核心:2.10.1]


您知道是什么导致了这个问题吗?

您不应该以这种方式使用XSLT组件

您尤其不应该尝试将“from”与XSLT结合使用,而应该将其与任何内部传输组件结合使用(直接用于实例)。我认为以下内容将满足您的要求

<route>
    <from uri="jms:queue:TradeEventsToESBQueue" />
    <multicast>
        <to uri="direct:confirmation"/>
        <to uri="direct:valuation"/>
    </multicast>
</route>

<route>
  <from uri="direct:confirmation"/>
  <to uri="xslt:com/tpt/esb/tradeevent/confirmation.xsl" />
  <to uri="log:output?showAll=true" />
</route>

<route>
  <from uri="direct:valuation"/>
  <to uri="xslt:com/tpt/esb/tradeevent/valuation.xsl" />
  <to uri="jms:queue:TradeValuationStartQueue1?jmsMessageType=Text" />
  <to uri="log:output?showAll=true" />
</route>