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 CredentialsorSSH 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:
DeleteorArchive
3. Content Modifier or Script(ファイル処理)
- ファイルの中身を処理する場合はScriptを追加(例:GroovyでCSVをJSONに変換)