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

SCDF Stream Design & Custom Processor


My current usecase is to receive HTTP Post message, validate it, transform into business object with interested fields (only) and push to nosql db.

I have completed successful poc on http source and mongodb sink on cloud foundry.

For request data validation & transformation, I do not find any available processor so assuming I will have to write one (actually, two).

Can a validation processor generate conditional output? Meaning,

  • send valid data to queue for further processing (here, transformation)?
  • send invalid data to log/error processing in mongodb sink?

Or should I design my stream in a different way? Appreciate your guidence.

Thanks


Solution

  • Yes; you can use a StreamBridge to select where to send the output.

    https://docs.spring.io/spring-cloud-stream/docs/3.1.2/reference/html/spring-cloud-stream.html#_sending_arbitrary_data_to_an_output_e_g_foreign_event_driven_sources