Skip to content

Commit 58eb5f2

Browse files
committed
Add 'What's New?` document to the ref guide
1 parent 0e95f3c commit 58eb5f2

File tree

9 files changed

+52
-19
lines changed

9 files changed

+52
-19
lines changed

spring-pulsar-docs/src/main/antora/modules/ROOT/nav.adoc

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
* xref:index.adoc[Overview]
2-
* xref:intro.adoc[Introduction]
3-
** xref:intro/project-state.adoc[Project Status]
4-
** xref:intro/system-requirements.adoc[System Requirements]
5-
** xref:intro/building.adoc[Building the Project]
6-
** xref:intro/getting-help.adoc[Getting Help]
2+
* xref:whats-new.adoc[]
3+
* xref:intro.adoc[]
4+
** xref:intro/project-state.adoc[]
5+
** xref:intro/system-requirements.adoc[]
6+
** xref:intro/building.adoc[]
7+
** xref:intro/getting-help.adoc[]
78
* xref:reference/reference.adoc[]
89
** xref:reference/pulsar.adoc[]
910
*** xref:reference/tombstones.adoc[]

spring-pulsar-docs/src/main/antora/modules/ROOT/pages/intro/building.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[building-project]]
2-
== Building the Project
2+
= Building the Project
33

44
include::../attributes/attributes-variables.adoc[]
55

spring-pulsar-docs/src/main/antora/modules/ROOT/pages/reference/pulsar.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ void listen(String message) {
296296

297297
TIP: The properties used are direct Pulsar consumer properties, not the `spring.pulsar.consumer` application configuration properties
298298

299+
[[listener-auto-consume]]
299300
==== Generic records with AUTO_CONSUME
300301
If there is no chance to know the type of schema of a Pulsar topic in advance, you can use the `AUTO_CONSUME` schema type to consume generic records.
301302
In this case, the topic deserializes messages into `GenericRecord` objects using the schema info associated with the topic.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
== Type mapping annotation
2+
3+
Another option for specifying default schema information to use for a particular message type is to mark the message class with the `@PulsarMessage` annotation.
4+
The schema info can be specified via the `schemaType` attribute on the annotation.
5+
6+
The following example configures the system to use JSON as the default schema when producing or consuming messages of type `Foo`:
7+
8+
[source,java,indent=0,subs="verbatim"]
9+
----
10+
@PulsarMessage(schemaType = SchemaType.JSON)
11+
record Foo(String value) {
12+
}
13+
----

spring-pulsar-docs/src/main/antora/modules/ROOT/pages/reference/schema-info/custom-schema-mapping.adoc

-13
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,3 @@ public SchemaResolverCustomizer<DefaultSchemaResolver> schemaResolverCustomizer(
3434
}
3535
}
3636
----
37-
38-
==== Type mapping annotation
39-
Another option for specifying default schema information to use for a particular message type is to mark the message class with the `@PulsarMessage` annotation.
40-
The schema info can be specified via the `schemaType` attribute on the annotation.
41-
42-
The following example configures the system to use JSON as the default schema when producing or consuming messages of type `Foo`:
43-
44-
[source,java,indent=0,subs="verbatim"]
45-
----
46-
@PulsarMessage(schemaType = SchemaType.JSON)
47-
record Foo(String value) {
48-
}
49-
----

spring-pulsar-docs/src/main/antora/modules/ROOT/pages/reference/schema-info/schema-info-listener.adoc

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ This removes the need to set the schema on the listener as the framework consult
1010

1111
include::custom-schema-mapping.adoc[]
1212

13+
[[listener-default-schema-annotation]]
14+
include::custom-schema-mapping-annotation.adoc[leveloffset=+2]
15+
1316
With this configuration in place, there is no need to set the schema on the listener, for example:
1417

1518
include::{listener-class}/listener-snippet.adoc[]

spring-pulsar-docs/src/main/antora/modules/ROOT/pages/reference/schema-info/schema-info-template.adoc

+4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ This removes the need to specify the schema as the framework consults the resolv
1313

1414
include::custom-schema-mapping.adoc[]
1515

16+
[[template-default-schema-annotation]]
17+
include::custom-schema-mapping-annotation.adoc[leveloffset=+2]
18+
1619
With this configuration in place, there is no need to set specify the schema on send operations.
1720

21+
[[template-auto-produce]]
1822
=== Producing with AUTO_SCHEMA
1923
If there is no chance to know the type of schema of a Pulsar topic in advance, you can use an {apache-pulsar-docs}/schema-get-started/#auto_produce[AUTO_PRODUCE] schema to publish a raw JSON or Avro payload as a `byte[]` safely.
2024

spring-pulsar-docs/src/main/antora/modules/ROOT/pages/reference/topic-resolution.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ NOTE: The `message-type` is the fully-qualified name of the message class.
3434

3535
WARNING: If the message (or the first message of a `Publisher` input) is `null`, the framework won't be able to determine the topic from it. Another method shall be used to specify the topic if your application is likely to send `null` messages.
3636

37+
[[default-topic-via-annotation]]
3738
=== Specified via annotation
3839

3940
When no topic is passed into the API and there are no custom topic mappings configured, the system looks for a `@PulsarMessage` annotation on the class of the message being produced or consumed.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
= What's new?
2+
3+
[[what-s-new-in-1-1-since-1-0]]
4+
== What's New in 1.1 Since 1.0
5+
:page-section-summary-toc: 1
6+
7+
This section covers the changes made from version 1.0 to version 1.1.
8+
9+
=== Auto Schema support
10+
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.
11+
See xref:./reference/pulsar.adoc#template-auto-produce[Producing with AUTO_SCHEMA] and xref:./reference/pulsar.adoc#listener-auto-consume[Consuming with AUTO_SCHEMA] for more details.
12+
13+
NOTE: While the above links focus on `PulsarTemplate` and `@PulsarListener`, this feature is also supported in `ReactivePulsarTemplate`, `@ReactivePulsarListener`, and `@PulsarReader`.
14+
Details for each can be found in their respective section of this reference guide.
15+
16+
=== Default topic/schema via message annotation
17+
You can now mark a message class with `@PulsarMessage` to specify the xref:./reference/pulsar.adoc#default-topic-via-annotation[default topic] and/or xref:./reference/pulsar.adoc#listener-default-schema-annotation[default schema] to use when producing/consuming messages of that type.
18+
19+
=== Remove checked exceptions
20+
The APIs provided by the framework no longer throw the checked `PulsarClientException`, but rather the unchecked `PulsarException`.
21+
22+
WARNING: 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.
23+
If you were actually handling the exception then you will need to replace `PulsarClientException` with `PulsarException` in your catch clause.

0 commit comments

Comments
 (0)