We have discussed and implemented Message as an input for a Java Function:
#4313
Perhaps its time to discuss supporting outputting Message as an option to that users can set any of the fields that is support in the Message interface for an outgoing message
We already have a message builder interface exposed via context, perhaps we can reuse it with some modification to just build a message for outputting instead of having to send it?
Maybe the API can be something like below:
public class TestFunction implements Function<String, Message<String>> {
@Override
public Message<String> process(String input, Context context) throws Exception {
FunctionMessageBuilder<String> builder = context.newOutputMessage();
Message message = builder.key("key").value("val").build();
context.publish("topic", Schema.STRING, message); // either send the message
return message; // or return from the function
}
}
@srkukarni @sijie @merlimat @wolfstudy thoughts?
We have discussed and implemented Message as an input for a Java Function:
#4313
Perhaps its time to discuss supporting outputting Message as an option to that users can set any of the fields that is support in the Message interface for an outgoing message
We already have a message builder interface exposed via context, perhaps we can reuse it with some modification to just build a message for outputting instead of having to send it?
Maybe the API can be something like below:
@srkukarni @sijie @merlimat @wolfstudy thoughts?