Can anyone suggest me ways to pass metadata between steps of SCDF pipe? Here are some of the use cases I'm trying to address:
I'm hoping that there is a way of sending such details in the rabbit or kafka message headers.
You can/should certainly utilize Message headers. Remember you control he return value of the handler method. If your handler method returns POJO, then the framework will create a Message from it copying certain headers etc. However, in your case if you want to control everything that goes into the Message (including headers) all you need is to define handler method that returns Message (see below):
@StreamListener(..)
@SendTo(..)
public Message<?> handle(String str) {
. . .
return MessageBuilder.withPayload(..).setHeader(..).setHeader(..).build();
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.