What’s new?

What’s New in 1.2 Since 1.1

This section covers the changes made from version 1.1 to version 1.2.

Custom Object Mapper

You can provide your own Jackson ObjectMapper that Pulsar will use when producing and consuming JSON messages. See Custom Object Mapper for more details.

Default Tenant and Namespace

You can specify a default tenant and/or namespace to use when producing or consuming messages against a non-fully-qualified topic URL. See Default Tenant / Namespace for more details.

Deprecations

PulsarClient#getPartitionsForTopic(java.lang.String)

Version 3.3.1 of the Pulsar client deprecates the getPartitionsForTopic(java.lang.String) in favor of getPartitionsForTopic(java.lang.String, boolean metadataAutoCreationEnabled).

PulsarTopic#builder

When using Spring Boot the PulsarTopicBuilder is now a registered bean that is configured with default values for domain, tenant, and namespace. Therefore, if you are using Spring Boot, you can simply inject the builder where needed. Otherwise, use one of the PulsarTopicBuilder constructors directly.

Breaking Changes

PulsarTopic#<init>

The PulsarTopic constructor now requires a fully qualified topic name (domain://tenant/namespace/name). If you are invoking the constructor you will need to be sure the topic you pass in is fully-qualified. A better alternative is to instead use the PulsarTopicBuilder as it does not require fully qualified names and will add default values for the missing components in the specified name.

What’s New in 1.1 Since 1.0

This section covers the changes made from version 1.0 to version 1.1.

Auto Schema support

If there is no chance to know the schema of a Pulsar topic in advance, you can use AUTO Schemas to produce/consume generic records to/from brokers. See Producing with AUTO_SCHEMA and Consuming with AUTO_SCHEMA for more details.

While the above links focus on PulsarTemplate and @PulsarListener, this feature is also supported in ReactivePulsarTemplate, @ReactivePulsarListener, and @PulsarReader. Details for each can be found in their respective section of this reference guide.

Default topic/schema via message annotation

You can now mark a message class with @PulsarMessage to specify the default topic and/or default schema to use when producing/consuming messages of that type.

Remove checked exceptions

The APIs provided by the framework no longer throw the checked PulsarClientException, but rather the unchecked PulsarException.

If you were previously catching or rethrowing PulsarClientException just to appease the compiler and were not actually handling the exception, you can simply remove your catch or throws clause. If you were actually handling the exception then you will need to replace PulsarClientException with PulsarException in your catch clause.

Testing support

The spring-pulsar-test module is now available to help test your Spring for Apache Pulsar applications. See Testing Applications for more details.