freeznet commented on pull request #9513:
URL: https://github.com/apache/pulsar/pull/9513#issuecomment-782099580


   
   > It depends on what the goal of the SDK is. If you look at the [python 
pfunc SDK 
example](https://pulsar.apache.org/docs/en/functions-overview/#content-based-routing-example),
 it is just `context.publish(topic, item)` If that is the experience you are 
after, then, it seems best to keep it simple and consistent. Given the way the 
Go pfunc SDK is structured, this seems like the option more in keeping with the 
intent.
   
   What I am really concerned is, `context.outputMessage()` might return user a 
dead producer, and user cannot recreate it because it is cached. 
   
   such as 
   
   ```
   producer := context.outputMessage("topic")
   producer.Close() // <- user close the producer
   ```
   
   later when user try to get a producer for `topic`, a closed producer will 
return since it is cached. 
   
   > > A relatively simple but not very mature idea is: we have a timing task 
in the background to process these resources regularly, for example: 30 minutes
   > Are there any objections to this idea? It makes sense to me.
   
   I agree with this, in addition, this setting should be configureable.


----------------------------------------------------------------
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]


Reply via email to