Closed
Description
This will avoid API signature permutation explosion as we extend the API in the future, thus avoiding a maintenance headache.
We will offer a hybrid API that consists of the following:
-
Keep the following existing non-fluent API for simple use cases:
send(message) send(topic, message) sendAsync(message) sendAsnyc(topic, message)
-
Replace all other variants w/ a fluent based DSL as such:
template.prepare() .message("5150") .toTopic("topic-one") //.toDefaultTopic() .withRouter(customRouter) .withInterceptor(customInterceptor) .withCustomizer(messageKeyCustomizer) .send(); // .sendAsync()
Points to consider
- This will lend itself well to the chunking/batching configuration enhancements (Configurable retry mechanism in PulsarTemplate sendAsync #16)
- Ensure the design accommodates template extensions such as (Explore the option of routable Pulsar template #67)
- What is the impact to
PulsarOperations
? Should we keep it?