178.6.2. JMS로 전송
아래 샘플에서는 파일 폴더를 폴링하고 파일 콘텐츠를 JMS 주제로 전송합니다. 파일의 내용을 BytesMessage 대신 TextMessage
로 원하는 대로 본문을 String으로 변환해야 합니다.As we want the content of the file as a TextMessage instead of a BytesMessage
, we need to convert the body to a String
:
from("file://orders"). convertBodyTo(String.class). to("jms:topic:OrdersTopic");