2013-04-12 4 views
0

FOP 구성 요소가 헤더를 전파하지 않는 것 같습니다. 아래 경로에서는 XSLT 구성 요소에서 헤더를 사용할 수 있으며 다른 쪽을 통과시킵니다. 그러나 fop 후에 그들은 모두 사라졌습니다.Apache Camel FOP 구성 요소가 헤더를 전파하지 않음

이것은 버그입니까? 누군가가 대안을 제안 할 수 있습니까?

<route> 
    <from uri="direct:render"/> 
    <to uri="xslt:file:{{rootDir}}/Report.xsl"/> 
    <to uri="fop:application/pdf"/> 
    <log message="Headers after fop ${headers}"/> 
</route> 

감사

답변

0

OK, 내 해결 방법은 다음과 같다 :

<route> 
    <from uri="direct:render"/> 

    <!-- Retain header value in property before it's lost --> 
    <setProperty propertyName="lostHeader"> 
     <simple>${header.lostHeader}</simple> 
    </setProperty> 

    <to uri="xslt:file:{{rootDir}}/Report.xsl"/> 
    <to uri="fop:application/pdf"/> 

    <!-- Restore it again --> 
    <setHeader headerName="lostHeader"> 
     <simple>${property.lostHeader}</simple> 
    </setHeader> 

    <log message="Headers after fop ${headers}"/> 

    <!-- Now it's available again here --> 
    <to uri="jms:jms/happyQueue"/> 
</route> 

내가 말했듯이, 그것은 물론, 당신은 당신이 개별적으로 필요한 모든 헤더를 처리해야 할 것, 해결 그리고 . 아마도 fop 구성 요소에 jira 버그를 기록 할 것입니다.

+0

그래, 버그 같아. –

+0

티켓을 기록 했으므로 수정을 기억합니다 : https://issues.apache.org/jira/browse/CAMEL- 6284 –