2016-11-14 3 views
1

낙타 경로 :낙타 프로세서에서 unmarshal()을 호출하는 방법은 무엇입니까?

from(source)   
    .idempotentConsumer(simple("${in.header.CamelFilePath}"), redisIdempotentRepository) 
    .process(pgpDecryptionProcessor) 
    .to(destination); 

PGPDecryptionProcessor는 :

public class PGPDecryptionProcessor implements Processor { 

    @Autowired 
    private PGPEncryptionManager pgpEncryptionManager; 

    @Override 
    public void process(Exchange exchange) throws Exception { 
    //do something to check whether it is encrypted 
    //get corrsponding dataformat for decryption 
    processDefinition.unmarshal(dataFormat); //How do i get processDefinition here 
    } 
    } 
} 

나는 ProcessDefinition.unmarshal(dataformat)를 호출해야합니다. 어떻게 처리 방법 안에 ProcessDefinition 개체를 얻을 수 있습니까?

답변

2

직접 다른 PARAM로 ExchangeExchange.getIn().getBody(InputStream.class)으로 DATAFORMAT의 비 정렬 화를 호출 할 수 있습니다 : 당신은 ProcessDefinition.unmarshal()를 호출 할 필요는 없습니다

dataformat.unmarshal(exchange, exachange.getIn().getBody(InputStream.class)); 

; ProcessDefinition은 사용할 데이터 형식 만 정의하고 마지막으로 메시지가 발생하면 ExchangeBody InputStream과 함께 Dataformat.unmarshal() 메서드가 호출됩니다.

관련 문제