2012-10-17 4 views
2

메시지를 대기열에서 라우팅합니다. -> xslt를 사용하여 메시지를 변환하고 다른 대기열, 로그로 전달합니다.Camel XSLT 메시지 라우팅 문제

<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> 

을 나는 다음과 같은 오류가 프로그램을 실행에 :

내 낙타의 구성은 다음과 같다

Caused by: org.apache.camel.ExpectedBodyTypeException: Could not extract IN message body as type: interface javax.xml.transform.Source body is: null at org.apache.camel.builder.xml.XsltBuilder.getSource(XsltBuilder.java:482)[64:org.apache.camel.camel-core:2.10.1] at org.apache.camel.builder.xml.XsltBuilder.process(XsltBuilder.java:125)[64:org.apache.camel.camel-core:2.10.1] at org.apache.camel.impl.ProcessorPollingConsumer.receive(ProcessorPollingConsumer.java:58)[64:org.apache.camel.camel-core:2.10.1]

이 문제의 원인이 무엇 어떤 아이디어가?

답변

2

그런 식으로 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> 
+0

감사합니다. – ABose