2016-12-31 40 views
1

我想創建一個簡單的彈簧集成應用程序,它獲取http數據並將它們轉發到兩個隊列。 在其中一個隊列中(現在忽略其他隊列),我想豐富數據,然後將它們轉發到AMQP 端點。SpelEvaluationException:EL1004E:(pos 8):方法調用:方法轉換(字節[])找不到

我的問題是以下情況除外:

MessagingTemplate $ TemporaryReplyChannel:接收應答消息,但 接收線程已經退出因異常而發送 請求消息:的ErrorMessage [有效載荷= org.springframework .messaging.MessageHandlingException: 嵌套的異常是 org.springframework.expression.spel.SpelEvaluationException: EL1004E:(位置8):方法調用:方法變換(字節[])不能 上com.EnrichmentService類型中找到,

我敢肯定的是,攝入的數據在我的富集的服務,這是爲了(在我的例子數據)在DTO工作,無法理解的方式 序列化。 我試着在我的DTO上實現Serializable。

我的問題是,我將如何調試通過我的渠道流動的類型?

我的代碼看起來像這樣:

@Bean 
public StandardIntegrationFlow ingestRaw() { 

    return IntegrationFlows.from(httpIngest()) 
      .headerFilter("accept-charset", "http_requestMethod") 
      .publishSubscribeChannel(Executors.newCachedThreadPool(), 
        input -> input 
          .subscribe(enrichmentFlow())) 
          .subscribe(anotherFlow())) 
      .get(); 
} 

@Bean 
public IntegrationFlow enrichmentFlow(){ 

    return flow -> flow.enrich(e -> e 
      .requestChannel(enrichmentRequestChannel()) 
      .replyChannel(enrichmentReplyChannel()) 
      .requestPayload(Message::getPayload)) 
      .transform(Transformers.fromJson(Data.class)) 
      .handle(Data.class, (payload, headers) -> enrichmentService.transform(payload)) 
      .handle(amqpOutboundFlow()); 
} 


@Bean 
public HttpRequestHandlingMessagingGateway httpIngest() { 
    return Http.inboundGateway(SINK_ENDPOINT_PATH).get(); 
} 


@Bean("enrichmentRequestChannel") 
public DirectChannel enrichmentRequestChannel(){ 
    return MessageChannels.direct().get(); 
} 

@Bean("enrichmentReplyChannel") 
public DirectChannel enrichmentReplyChannel(){ 
    return MessageChannels.direct().get(); 
} 


@Bean 
public AmqpOutboundEndpoint amqpOutboundFlow() { 
    return Amqp.outboundAdapter(this.amqpTemplate).routingKeyExpression("enrichOut.enrichedGroup").get(); 
} 
+0

顯示,請爲此錯誤顯示更多堆棧跟蹤 –

+0

M-m-m。誰訂閱了「enrichmentRequestChannel」?顯示,請流, –

+0

我所有的代碼都在那裏。因爲我是一個春季整合新手,我想我錯了什麼... – jah

回答

0

我犯了一個錯誤,忘了取消註釋的綁定我在使用之前,所以TransformationService以兩種方式(至少它似乎)的約束。

@ServiceActivator(inputChannel = "enrichmentRequestChannel", outputChannel = "enrichmentReplyChannel") 
public EnrichedData transform(Data data) { 
相關問題