2017-04-12 139 views
0

我想通過駱駝路由將PDF發送到ActiveMQ隊列。 我需要在另一條駱駝路線中提取這些PDF。 我無法從隊列中提取數據。我也試過.marshal().base64()。數據到達Message Broker,但我無法解壓縮。通過ActiveMQ發送和接收PDF

錯誤之後會出現:

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/util/backoff/BackOff at org.apache.camel.component.jms.JmsConfiguration.chooseMessageListenerContainerImplementation(JmsConfiguration.java:466) at org.apache.camel.component.jms.JmsConfiguration.createMessageListenerContainer(JmsConfiguration.java:456).....

是否有人有想法?當使用base64編組時,該對象是org.apache.camel.converter.stream.InputStreamCache。 該對象是org.apache.camel.component.file.GenericFile當只發送PDF到隊列。

如何提取數據以獲取該PDF?

這是傳遞兩個不同隊列的代碼。但是我甚至無法提取數據。

from("file:src/main/resources/test?noop=true") 
.to("jms:queue:PDF") 
.marshal().base64()     
.to("jms:queue:BASE64_PDF") 
+0

是什麼你的ActiveMQ和駱駝版本? –

+0

ActiveMQ.version 2.18,Camel.version 2.16 – sitnam

+0

ActiveMQ.version 5.7,對不起 – sitnam

回答

0

這個例子中工作得很好

 from("file:src/main/resources/test?noop=true") 
     .to("jms:queue:PDF"); 
     from("jms:queue:PDF") 
     .to("file:src/main/resources/testReceive"); 

它是依賴關係的問題不是駱駝,驗證您有在classpath彈簧核心xxxjar或ActiveMQ的 - 全xxjar

+0

非常感謝! 彈簧核心依賴失蹤! 它的工作原理! – sitnam