How sartrebrasil/sftp-jms-bridge-v3 works
sftp-jms-bridge is a Spring Integration service that streams tenant documents from remote SFTP into JMS without local-file staging. The documented path claims each file at ingress, reads and enriches its bytes, then publishes either a single-document or grouped JSON envelope. After JMS commit it marks claims processed and moves remote files; a scheduled reconciler retries orphaned moves. The README documents these relationships, but no source excerpts were provided, so implementation-level call ownership and optional details are not independently verified.
Main entry points: JmsPublicationService.java JMS publication · DocumentFactory.java Document factory · IdempotencyService.java Idempotency service · IngressClaimGateway.java Ingress claim
Components 21
SFTP ingress
- Streaming poller
src/main/java/com/example/sftpjms/config/SftpIntegrationConfig.java - Worker channel
src/main/java/com/example/sftpjms/config/AsyncConfig.java - Ingress claim
src/main/java/com/example/sftpjms/idempotency/ingress/IngressClaimGateway.java
Document processing
- Document factory
src/main/java/com/example/sftpjms/service/DocumentFactory.java - Content type
src/main/java/com/example/sftpjms/document/ContentTypeResolver.java - Document model
src/main/java/com/example/sftpjms/model/Document.java - Mode routing
src/main/java/com/example/sftpjms/config/InboundFlowConfig.java - Document grouping
src/main/java/com/example/sftpjms/config/RedisGroupingConfig.java
JMS delivery
- JMS publication
src/main/java/com/example/sftpjms/service/JmsPublicationService.java - JSON envelope
src/main/java/com/example/sftpjms/jms/JmsEnvelopeFactory.java - Envelope serializer
src/main/java/com/example/sftpjms/jms/JmsEnvelopeSerializer.java - Gzip Base64
src/main/java/com/example/sftpjms/jms/encoding/GzipBase64ContentEncoder.java
Reliability and tenancy
- Tenant routing
src/main/java/com/example/sftpjms/tenant/TenantIngressFlowManager.java - Idempotency service
src/main/java/com/example/sftpjms/idempotency/IdempotencyService.java - Idempotency store
src/main/java/com/example/sftpjms/idempotency/RedisIdempotencyStore.java - SFTP lifecycle
src/main/java/com/example/sftpjms/service/SftpLifecycleService.java - Move reconciler
src/main/java/com/example/sftpjms/reconciliation/SftpMoveReconciliationService.java - Lease error handler
src/main/java/com/example/sftpjms/idempotency/error/ReleaseLeaseOnErrorHandler.java
Other components
- SFTP server
- JMS broker
- Redis
Connections 23
- SFTP server → Streaming poller: streams files
README.md - Streaming poller → Worker channel: dispatches work
README.md - Worker channel → Ingress claim: dispatches
README.md - Ingress claim → Idempotency service: claims lease
README.md - Ingress claim → Document factory: forwards stream
README.md - Document factory → Content type: resolves type
README.md - Document factory → Document model: creates
README.md - Document factory → Mode routing: forwards document
README.md - Tenant routing → Streaming poller: configures tenant polls
README.md - Mode routing → JMS publication: routes single
README.md - Mode routing → Document grouping: routes grouped
README.md - Document grouping → JMS publication: releases group
README.md - JMS publication → JSON envelope: creates envelope
README.md - JSON envelope → Envelope serializer: serializes
README.md - Envelope serializer → Gzip Base64: encodes content
README.md - JMS publication → JMS broker: publishes transactionally
README.md - JMS publication → Idempotency service: promotes after commit
README.md - Idempotency service → Idempotency store: uses store
README.md - Idempotency store → Redis: persists claims
README.md - JMS publication → SFTP lifecycle: registers post-commit move
README.md - SFTP lifecycle → SFTP server: moves processed files
README.md - Move reconciler → SFTP server: retries orphan moves
README.md - Lease error handler → Idempotency service: releases lease
README.md