2017-10-16 7 views
0

int-file : int-ftp : int-ftp : 원격 디렉터리 및 int-ftp로 파일을 이동시키는 outbound-channel-adapter : outbound-gateway는 원격 디렉토리의 파일을 삭제합니다.Int : 스플리터가 채널을 호출하기 위해 메시지를 보내지 않습니다.

int-file : 인바운드 - 채널 어댑터는 폴링하여 int-ftp : outbound-channel-adapter에 메시지를 보내고 두 번째 폴링하면 int-ftp : outbound-gateway로 메시지를 보냅니다.

int : splitter를 사용하면 하나의 파일에 대해 하나의 메시지 만 수신 할 수 있으며 하나의 채널 만 호출됩니다. 두 채널 모두에 모든 폴링 메시지를 보내려고합니다.

예는 다음과 같습니다

이제

는 작업 :

  1. 처음 조사 값 int - FTP를 위해 메시지를 전송 : 아웃 바운드 채널 어댑터를
  2. 두 번째 조사를 int로 메시지를 전송 -ftp : outbound-gateway
  3. 세 번째 시간 폴링은 int-ftp로 메시지를 보냅니다. outbound-channel-adapter
  4. 아웃 바운드 채널 어댑터 :

    1.First 시간 조사는 int로 - FTP를 위해 메시지를 전송 :로

이 달성하고자하는 아웃 바운드 게이트웨이 :

  • 네 번째 시간 조사 값 int - FTP를 위해 메시지를 전송 및 INT-FTP : 아웃 바운드 채널 어댑터 및 int로-FTP를 : 아웃 바운드 게이트웨이 2.Second 시간 여론 조사 - FTP를 int로 메시지를 보내는 아웃 바운드 게이트웨이를

    사전에 감사

    <int-file:inbound-channel-adapter id="inErrorINPRm" 
               channel="errorRm" 
               directory="in/error" 
               > 
        <int:poller fixed-rate="5000" /> 
    </int-file:inbound-channel-adapter> 
    
    <int:channel id="errorRm"></int:channel> 
    <int:channel id="ErrorRmMv"></int:channel> 
    <int:channel id="ftpINPfromError"></int:channel> 
    
    <int:splitter id="splitter" input-channel="errorRm" output-channel="ErrorRmMv"/> 
    
    <int-ftp:outbound-channel-adapter id="ftpError" 
               channel="ErrorRmMv" 
               session-factory="ClientFactory" 
               auto-create-directory="true" 
               remote-directory="in/error" 
               > 
    </int-ftp:outbound-channel-adapter> 
    
    <int:header-enricher id="header-enricher-error" input-channel="ErrorRmMv" output-channel="ftpINPfromError"> 
        <int:header name="file_remoteDirectory" value="in/working"/> 
    
    </int:header-enricher> 
    
    <int-ftp:outbound-gateway id="gatewayRmfromError" 
              session-factory="ClientFactory" 
              expression="file_remoteDirectory" 
              request-channel="ftpINPfromError" 
              command="rm" 
              > 
    </int-ftp:outbound-gateway> 
    
  • 답변

    0

    스플리터는 분할 할 필요가 없습니다. 페이로드는 이미 하나의 File입니다.

    스플리터는 각 목록 요소에 대한 메시지로 목록을 분할하기위한 것입니다. 당신은 그들이 호출되는 순서가 명확하게하려면 enricher에 어댑터에 order="1"order="2"을 추가 할 수 있습니다 -

    당신은 어댑터의 입력 채널, 및 헤더 enricher <int:publish-subscribe-channel/>을 확인해야합니다.

    +0

    @Gary Russell – ram

    관련 문제