Created
May 23, 2023 19:56
-
-
Save itasyurt/4c2020bddd26b0144dd8ff39924d275e to your computer and use it in GitHub Desktop.
FileChanges Listener
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.kafka.annotation.KafkaListener | |
import org.springframework.stereotype.Component | |
@Component | |
class FileChangedListener { | |
@KafkaListener(topics = ["changed_files"]) | |
fun listen(file: String) { | |
// Process the file here | |
uploadFileToSFTP(file) | |
} | |
private fun uploadFileToSFTP(file: String) { | |
// Implement SFTP upload logic here | |
// Use a library like JSch or Spring Integration SFTP | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment