Skip to content

Add fluent API for PulsarTemplate #68

Closed
@onobc

Description

@onobc

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions