1
votes

I'm building a cloud stream application using Spring with Azure Event Hub and Service bus. In my use case I'm trying to achieve the following functionality :

  1. Application that receives messages from a single binder (event hub)
  2. Process the messages in a few steps, step A, B, C for example
  3. Each step in the process creates objects
  4. Stream the objects which were created in each step to different binders. If sending messages failed in any step, don't proceed

The question is, does the message sending is sync or async? Will it wait until all messages sent in step A before executing the next steps?

1

1 Answers

1
votes

To make sure the message production happens synchronously you can simply set the spring.cloud.stream.eventhub.bindings.<channel-name>.producer.sync property to true.

The related documentation can be found here.

You can see the property referenced in the code here and here.