0

We're using SubscribableChannel, MessageChannel and PollableMessageSource and configured using @EnableBinding and @StreamListner. Now we need to migrate to functional approach. SubscribableChannel and MessageChannel can be converted using Consumer and Supplier beans but we're not able to migrate PollableMessageSource. Since functions are disabled if we use @EnableBinding, hence we're stuck for migration. We tried looking into @PollableBean but seems it works only for Reactive Supplier with finite streams. Is there any way of doing it? Ref: https://cloud.spring.io/spring-cloud-stream/reference/html/spring-cloud-stream.html

VaibS
  • 1,627
  • 1
  • 15
  • 21

1 Answers1

0

You can wrap a function and a PollableMessageSource in a bean and bind to it using @EnableBinding instead of binding to the function. See https://github.com/spring-cloud/stream-applications/blob/master/applications/sink/tasklauncher-sink/src/main/java/org/springframework/cloud/stream/app/tasklauncher/sink/TaskLauncherSinkConfiguration.java for an example.

dturanski
  • 1,723
  • 1
  • 13
  • 8
  • We need to remove @EnableBinding and use only functions. Found that it is not yet supported. https://github.com/spring-cloud/spring-cloud-stream/issues/1956 – VaibS Aug 26 '20 at 14:15