SAP Integration Suite × SFTP:ファイル監視&処理の実装例

SAP Integration SuiteでSFTPからファイルをポーリングして処理する方法

はじめに

SAP Integration Suite(Cloud Integration)で、SFTP上のファイルを定期的に取得し、処理・削除するiFlowを構築する方法を解説します。

前提条件

  • BTPアカウント(Integration Suite有効)
  • SFTPサーバへのアクセス情報(ホスト名/ポート/ユーザ/パスワード or 鍵)
  • Security Materialの登録権限

SFTP接続情報の準備

1. 接続方式の確認(パスワード or 公開鍵)

  • パスワード認証:そのまま登録可
  • 公開鍵認証:SSH Key Pair を生成し、SFTPサーバに公開鍵を渡す

2. Integration SuiteでSecurity Material登録

  • Type: User Credentials or SSH Key
  • Identifier: SFTP_CREDENTIAL など
  • Credential nameはiFlowで使う名前と一致させること

Integration Flowの作成手順

1. Sender設定(Timer)

  • Adapter Type: Timer
  • Polling Interval: 例)5分ごと

2. Receiver(SFTP)設定

  • Adapter Type: SFTP
  • Operation: Get
  • Directory: /inbox など
  • File Name: *.csv(ワイルドカード可)
  • Credential: SFTP_CREDENTIAL
  • Post Processing: Delete or Archive

3. Content Modifier or Script(ファイル処理)

  • ファイルの中身を処理する場合はScriptを追加(例:GroovyでCSVをJSONに変換)

4. End Message(例えばLog)

ファイルポーリング全体構成イメージ(図)

コメントする