Reputation: 1
I am unable to extract custom Message headers in a Function<Message,?> when using functional bean definitions for Spring cloud function.
Is there any way to extract the user defined Messsage headers that were passed in the request ?
@SpringBootConfiguration
public class Demo implements Function<Message<String>,String> {
public static void main(String[] args) {
FunctionalSpringApplication.run(Demo.class,args);
}
@Override
public String apply(Message<String> stringMessage) {
final MessageHeaders headers = stringMessage.getHeaders();
headers.entrySet().forEach(System.out::println);
return stringMessage.getPayload().toUpperCase();
}
}
Only 3 fixed headers are passed everytime
However, any custom headers that are passed in the request are not available in the message headers.
Upvotes: 0
Views: 131