wolfstudy commented on issue #4093: [issue#4042] improve java functions API
URL: https://github.com/apache/pulsar/pull/4093#issuecomment-485070352
 
 
   > The usage would something like this:
   > 
   > ```
   > MessageConf messageConf = 
MessageConf.Builder().key("key").properties(myProperties).build()
   > 
   > context.publish("output", "my-topic", messageConf)
   > 
   > # or for output message
   > 
   > context.setOutputMessageConf(messageConf)
   > ```
   
   
   My think is that we provide the user with a method, es: `newOutputMessage()` 
that allows the user to get the `TypedMessageBuilder`, so that the user can set 
the configuration they want and then `sendAsync()` it out.
   
   The usage would something like this:
   
   ```
   TypedMessageBuilder messageBuilder = 
newOutputMessage("output",Schema.JSON());
   
   
messageBuilder.value("my-topic").key("key").properties("myproperties").sendAsync();
   ```
   
   Do you think this way can solve the problems we have encountered?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to