Search code examples
spring-cloud-streamspring-cloud-dataflow

How to undeploy stream after X hours in Spring CloudDataflow?


I need to deploy a stream on Spring CloudDataflow server and undeploy it automatically after 24 or 48h unless someone undeploys it earlier.

Could anyone give me an idea how to approach this because I am not even sure where to begin.

Any help is appriciated.


Solution

  • SCDF provides REST-APIs to undeploy a stream identified by its name. You can undeploy a foo stream with the following endpoint, for instance.

    https://HOST:PORT/streams/deployments/foo

    With that, you could use a scheduler system to schedule this undeploy operation for a particular date/time or by cron expression.