Given a Supplier function to produce messages in Spring Cloud Stream function, like:
@Bean
Supplier<Flux<Message<PayLoad>>> sendMessage() {
return () -> getMessageSink().asFlux().log();
}
or this version
@Bean
Supplier<Flux<PayLoad>> sendMessage() {
return () -> getMessageSink().asFlux().log();
}
and
class PayLoad {
public String header1;
public String header2;
public String message;
}
How would I configure the headers in my application.yml? I am assuming I need some form or spEl function or other.
I've tried using this from tickets filed, but to no avail and the documentation around this seems elusive.
spring:
application:
name: messages
cloud:
function:
definition: sendMessage;consumeMessage
configuration:
sendMessage:
input-header-mapping-expression:
header1: spel.function.expression="payload.header1"
header2: spel.function.expression="payload.header2"