Tilak
Tilak

Reputation: 373

Post processing after Spring cloud stream Function

Simple function like below can be consume and produce message.

@Bean
public Function<String, String> toUpperCase() {
    return s -> s.toUpperCase();
}

Is there any option in spring cloud stream to return control to the application after publishing/supplying a message?

I have an use case to update state in database after publishing the message.

Upvotes: 1

Views: 526

Answers (1)

Gary Russell
Gary Russell

Reputation: 174554

Use a Consumer instead of a Function and send the result using the StreamBridge instead.

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

Upvotes: 3

Related Questions