Skip to content

Commit b868682

Browse files
Cosmetic doc improvements part 4
* fix some errors as per PR comments * fix a similar previous '->' error
1 parent c5c93ad commit b868682

File tree

14 files changed

+89
-92
lines changed

14 files changed

+89
-92
lines changed

spring-kafka-docs/src/main/antora/modules/ROOT/pages/appendix/native-images.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[native-images]]
22
= Native Images
33

4-
https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#aot[Spring AOT] native hints are provided to assist in developing native images for Spring applications that use Spring for Apache Kafka, including hints for AVRO generated classes used in `@KafkaListener` s.
4+
https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#aot[Spring AOT] native hints are provided to assist in developing native images for Spring applications that use Spring for Apache Kafka, including hints for AVRO generated classes used in `@KafkaListener`+++s+++.
55

66
IMPORTANT: `spring-kafka-test` (and, specifically, its `EmbeddedKafkaBroker`) is not supported in native images.
77

spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/exactly-once.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ See xref:kafka/annotation-error-handling.adoc#after-rollback[After-rollback Proc
1010

1111
Using transactions enables Exactly Once Semantics (EOS).
1212

13-
This means that, for a `read+++->+++process+++->+++write` sequence, it is guaranteed that the **sequence** is completed exactly once.
13+
This means that, for a `read -> process -> write` sequence, it is guaranteed that the **sequence** is completed exactly once.
1414
(The read and process have at least once semantics).
1515

1616
Spring for Apache Kafka version 3.0 and later only supports `EOSMode.V2`:

spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/headers.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ DefaultKafkaHeaderMapper inboundMapper = DefaultKafkaHeaderMapper.forInboundOnly
145145

146146
This will exclude all headers beginning with `abc` and include all others.
147147

148-
By default, the `DefaultKafkaHeaderMapper` is used in the `MessagingMessageConverter` and `BatchMessagingMessageConverter`, as long as Jackson is on the class path.
148+
By default, the `DefaultKafkaHeaderMapper` is used in the `MessagingMessageConverter` and `BatchMessagingMessageConverter`, as long as Jackson is on the classpath.
149149

150150
With the batch converter, the converted headers are available in the `KafkaHeaders.BATCH_CONVERTED_HEADERS` as a `List<Map<String, Object>>` where the map in a position of the list corresponds to the data position in the payload.
151151

spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/micrometer.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[[monitoring-listener-performance]]
55
== Monitoring Listener Performance
66

7-
Starting with version 2.3, the listener container will automatically create and update Micrometer `Timer`+++s+++ for the listener, if `Micrometer` is detected on the class path, and a single `MeterRegistry` is present in the application context.
7+
Starting with version 2.3, the listener container will automatically create and update Micrometer `Timer`+++s+++ for the listener, if `Micrometer` is detected on the classpath, and a single `MeterRegistry` is present in the application context.
88
The timers can be disabled by setting the `ContainerProperty`+++'+++s `micrometerEnabled` to `false`.
99

1010
Two timers are maintained - one for successful calls to the listener and one for failures.
@@ -24,7 +24,7 @@ NOTE: With the concurrent container, timers are created for each thread and the
2424
[[monitoring-kafkatemplate-performance]]
2525
== Monitoring KafkaTemplate Performance
2626

27-
Starting with version 2.5, the template will automatically create and update Micrometer `Timer`+++s for send operations, if `Micrometer` is detected on the class path, and a single `MeterRegistry` is present in the application context.
27+
Starting with version 2.5, the template will automatically create and update Micrometer `Timer`+++s for send operations, if `Micrometer` is detected on the classpath, and a single `MeterRegistry` is present in the application context.
2828
The timers can be disabled by setting the template's `micrometerEnabled` property to `false`.
2929

3030
Two timers are maintained - one for successful calls to the listener and one for failures.

spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/serdes.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public ProducerFactory<String, Thing> kafkaProducerFactory(JsonSerializer custom
185185
Setters are also provided, as an alternative to using these constructors.
186186
====
187187

188-
Starting with version 2.2, you can explicitly configure the deserializer to use the supplied target type and ignore type information in headers by using one of the overloaded constructors that have a boolean `useHeadersIfPresent` parameter (which is `true` by default).
188+
Starting with version 2.2, you can explicitly configure the deserializer to use the supplied target type and ignore type information in headers by using one of the overloaded constructors that have a boolean `useHeadersIfPresent` argument (which is `true` by default).
189189
The following example shows how to do so:
190190

191191
[source, java]
@@ -509,7 +509,7 @@ Accessor methods will be used to lookup the property name as field in the receiv
509509
The `@JsonPath` expression allows customization of the value lookup, and even to define multiple JSON Path expressions, to look up values from multiple places until an expression returns an actual value.
510510

511511
To enable this feature, use a `ProjectingMessageConverter` configured with an appropriate delegate converter (used for outbound conversion and converting non-projection interfaces).
512-
You must also add `spring-data:spring-data-commons` and `com.jayway.jsonpath:json-path` to the class path.
512+
You must also add `spring-data:spring-data-commons` and `com.jayway.jsonpath:json-path` to the classpath.
513513

514514
When used as the parameter to a `@KafkaListener` method, the interface type is automatically passed to the converter as normal.
515515

spring-kafka-docs/src/main/antora/modules/ROOT/pages/quick-tour.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
= Quick Tour
33

44
Prerequisites: You must install and run Apache Kafka.
5-
Then you must put the Spring for Apache Kafka (`spring-kafka`) JAR and all of its dependencies on your class path.
5+
Then you must put the Spring for Apache Kafka (`spring-kafka`) JAR and all of its dependencies on your classpath.
66
The easiest way to do that is to declare a dependency in your build tool.
77

88
If you are not using Spring Boot, declare the `spring-kafka` jar as a dependency in your project.

spring-kafka-docs/src/main/antora/modules/ROOT/pages/retrytopic/accessing-delivery-attempts.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ To access blocking and non-blocking delivery attempts, add these headers to your
99
@Header(name = RetryTopicHeaders.DEFAULT_HEADER_ATTEMPTS, required = false) Integer nonBlockingAttempts
1010
----
1111

12-
Blocking delivery attempts are only provided if you set `ContainerProperties` <<deliveryAttemptHeader>> to `true`.
12+
Blocking delivery attempts are only provided if you set `ContainerProperties`+++'+++s xref:kafka/container-props.adoc#deliveryAttemptHeader[deliveryAttemptHeader] to `true`.
1313

1414
Note that the non blocking attempts will be `null` for the initial delivery.
1515

spring-kafka-docs/src/main/antora/modules/ROOT/pages/retrytopic/dlt-strategies.adoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[[dlt-strategies]]
2-
= Dlt Strategies
2+
= DLT Strategies
33

44
The framework provides a few strategies for working with DLTs.
55
You can provide a method for DLT processing, use the default logging method, or have no DLT at all.
66
Also you can choose what happens if DLT processing fails.
77

88
[[dlt-processing-method]]
9-
== Dlt Processing Method
9+
== DLT Processing Method
1010

1111
You can specify the method used to process the DLT for the topic, as well as the behavior if that processing fails.
1212

@@ -18,16 +18,16 @@ Note that the same method will be used for all the `@RetryableTopic` annotated m
1818
@RetryableTopic
1919
@KafkaListener(topics = "my-annotated-topic")
2020
public void processMessage(MyPojo message) {
21-
// ... message processing
21+
// ... message processing
2222
}
2323
2424
@DltHandler
2525
public void processMessage(MyPojo message) {
26-
// ... message processing, persistence, etc
26+
// ... message processing, persistence, etc
2727
}
2828
----
2929

30-
The DLT handler method can also be provided through the RetryTopicConfigurationBuilder.dltHandlerMethod(String, String) method, passing as arguments the bean name and method name that should process the DLT's messages.
30+
The DLT handler method can also be provided through the `RetryTopicConfigurationBuilder.dltHandlerMethod(String, String)` method, passing as arguments the bean name and method name that should process the DLT's messages.
3131

3232
[source, java]
3333
----
@@ -49,12 +49,12 @@ public class MyCustomDltProcessor {
4949
}
5050
5151
public void processDltMessage(MyPojo message) {
52-
// ... message processing, persistence, etc
52+
// ... message processing, persistence, etc
5353
}
5454
}
5555
----
5656

57-
NOTE: If no DLT handler is provided, the default RetryTopicConfigurer.LoggingDltListenerHandlerMethod is used.
57+
NOTE: If no DLT handler is provided, the default `RetryTopicConfigurer.LoggingDltListenerHandlerMethod` is used.
5858

5959
Starting with version 2.8, if you don't want to consume from the DLT in this application at all, including by the default handler (or you wish to defer consumption), you can control whether or not the DLT container starts, independent of the container factory's `autoStartup` property.
6060

@@ -77,7 +77,7 @@ In the latter the consumer ends the execution without forwarding the message.
7777
DltStrategy.FAIL_ON_ERROR)
7878
@KafkaListener(topics = "my-annotated-topic")
7979
public void processMessage(MyPojo message) {
80-
// ... message processing
80+
// ... message processing
8181
}
8282
----
8383

@@ -96,7 +96,7 @@ public RetryTopicConfiguration myRetryTopic(KafkaTemplate<Integer, MyPojo> templ
9696
NOTE: The default behavior is to `ALWAYS_RETRY_ON_ERROR`.
9797

9898
IMPORTANT: Starting with version 2.8.3, `ALWAYS_RETRY_ON_ERROR` will NOT route a record back to the DLT if the record causes a fatal exception to be thrown,
99-
such as a `DeserializationException` because, generally, such exceptions will always be thrown.
99+
such as a `DeserializationException`, because, generally, such exceptions will always be thrown.
100100

101101
Exceptions that are considered fatal are:
102102

@@ -125,7 +125,7 @@ In this case after retrials are exhausted the processing simply ends.
125125
DltStrategy.NO_DLT)
126126
@KafkaListener(topics = "my-annotated-topic")
127127
public void processMessage(MyPojo message) {
128-
// ... message processing
128+
// ... message processing
129129
}
130130
----
131131

spring-kafka-docs/src/main/antora/modules/ROOT/pages/retrytopic/features.adoc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ It includes:
2323
backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 5000))
2424
@KafkaListener(topics = "my-annotated-topic")
2525
public void processMessage(MyPojo message) {
26-
// ... message processing
26+
// ... message processing
2727
}
2828
----
2929

@@ -33,7 +33,7 @@ public void processMessage(MyPojo message) {
3333
public RetryTopicConfiguration myRetryTopic(KafkaTemplate<String, MyPojo> template) {
3434
return RetryTopicConfigurationBuilder
3535
.newInstance()
36-
.fixedBackoff(3000)
36+
.fixedBackoff(3_000)
3737
.maxAttempts(4)
3838
.create(template);
3939
}
@@ -53,25 +53,25 @@ public RetryTopicConfiguration myRetryTopic(KafkaTemplate<String, MyPojo> templa
5353
}
5454
----
5555

56-
NOTE: The default backoff policy is `FixedBackOffPolicy` with a maximum of 3 attempts and 1000ms intervals.
56+
NOTE: The default back off policy is `FixedBackOffPolicy` with a maximum of 3 attempts and 1000ms intervals.
5757

5858
NOTE: There is a 30-second default maximum delay for the `ExponentialBackOffPolicy`.
59-
If your back off policy requires delays with values bigger than that, adjust the maxDelay property accordingly.
59+
If your back off policy requires delays with values bigger than that, adjust the `maxDelay` property accordingly.
6060

6161
IMPORTANT: The first attempt counts against `maxAttempts`, so if you provide a `maxAttempts` value of 4 there'll be the original attempt plus 3 retries.
6262

6363
[[global-timeout]]
64-
== Global timeout
64+
== Global Timeout
6565

6666
You can set the global timeout for the retrying process.
6767
If that time is reached, the next time the consumer throws an exception the message goes straight to the DLT, or just ends the processing if no DLT is available.
6868

6969
[source, java]
7070
----
71-
@RetryableTopic(backoff = @Backoff(2000), timeout = 5000)
71+
@RetryableTopic(backoff = @Backoff(2_000), timeout = 5_000)
7272
@KafkaListener(topics = "my-annotated-topic")
7373
public void processMessage(MyPojo message) {
74-
// ... message processing
74+
// ... message processing
7575
}
7676
----
7777

@@ -81,8 +81,8 @@ public void processMessage(MyPojo message) {
8181
public RetryTopicConfiguration myRetryTopic(KafkaTemplate<String, MyPojo> template) {
8282
return RetryTopicConfigurationBuilder
8383
.newInstance()
84-
.fixedBackoff(2000)
85-
.timeoutAfter(5000)
84+
.fixedBackoff(2_000)
85+
.timeoutAfter(5_000)
8686
.create(template);
8787
}
8888
----
@@ -100,7 +100,7 @@ You can also set it to traverse the causes to lookup nested exceptions.
100100
@RetryableTopic(include = {MyRetryException.class, MyOtherRetryException.class}, traversingCauses = true)
101101
@KafkaListener(topics = "my-annotated-topic")
102102
public void processMessage(MyPojo message) {
103-
throw new RuntimeException(new MyRetryException()); // Will retry
103+
throw new RuntimeException(new MyRetryException()); // will retry
104104
}
105105
----
106106

@@ -168,7 +168,7 @@ NOTE: The default behavior is to include all topics.
168168

169169
Unless otherwise specified the framework will auto create the required topics using `NewTopic` beans that are consumed by the `KafkaAdmin` bean.
170170
You can specify the number of partitions and the replication factor with which the topics will be created, and you can turn this feature off.
171-
Starting with version 3.0, the default replication factor is `-1`, meaning use the broker default.
171+
Starting with version 3.0, the default replication factor is `-1`, meaning using the broker default.
172172
If your broker version is earlier than 2.4, you will need to set an explicit value.
173173

174174
IMPORTANT: Note that if you're not using Spring Boot you'll have to provide a KafkaAdmin bean in order to use this feature.
@@ -178,13 +178,13 @@ IMPORTANT: Note that if you're not using Spring Boot you'll have to provide a Ka
178178
@RetryableTopic(numPartitions = 2, replicationFactor = 3)
179179
@KafkaListener(topics = "my-annotated-topic")
180180
public void processMessage(MyPojo message) {
181-
// ... message processing
181+
// ... message processing
182182
}
183183
184184
@RetryableTopic(autoCreateTopics = false)
185185
@KafkaListener(topics = "my-annotated-topic")
186186
public void processMessage(MyPojo message) {
187-
// ... message processing
187+
// ... message processing
188188
}
189189
----
190190
[source, java]
@@ -206,7 +206,7 @@ public RetryTopicConfiguration myOtherRetryTopic(KafkaTemplate<Integer, MyPojo>
206206
}
207207
----
208208

209-
NOTE: By default the topics are autocreated with one partition and a replication factor of -1 (meaning use the broker default).
209+
NOTE: By default the topics are autocreated with one partition and a replication factor of -1 (meaning using the broker default).
210210
If your broker version is earlier than 2.4, you will need to set an explicit value.
211211

212212
[[retry-headers]]
@@ -235,7 +235,7 @@ protected void configureCustomizers(CustomizersConfigurer customizersConfigurer)
235235
}
236236
----
237237

238-
Starting with version 2.8.4, if you wish to add custom headers (in addition to the retry information headers added by the factory, you can add a `headersFunction` to the factory - `factory.setHeadersFunction((rec, ex) -> { ... })`
238+
Starting with version 2.8.4, if you wish to add custom headers (in addition to the retry information headers added by the factory, you can add a `headersFunction` to the factory - `factory.setHeadersFunction((rec, ex) +++->+++ { +++...+++ })`.
239239

240240
By default, any headers added will be cumulative - Kafka headers can contain multiple values.
241241
Starting with version 2.9.5, if the `Headers` returned by the function contains a header of type `DeadLetterPublishingRecoverer.SingleRecordHeader`, then any existing values for that header will be removed and only the new single value will remain.

spring-kafka-docs/src/main/antora/modules/ROOT/pages/retrytopic/retry-topic-combine-blocking.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ See xref:retrytopic/retry-config.adoc#retry-topic-global-settings[Configuring Gl
1515
protected void configureBlockingRetries(BlockingRetriesConfigurer blockingRetries) {
1616
blockingRetries
1717
.retryOn(MyBlockingRetryException.class, MyOtherBlockingRetryException.class)
18-
.backOff(new FixedBackOff(3000, 5));
18+
.backOff(new FixedBackOff(3_000, 5));
1919
}
2020
2121
----

0 commit comments

Comments
 (0)