Skip to content

Commit 84a7a70

Browse files
Jay Bryantartembilan
authored andcommitted
Editing pass for spring-kafka
I edited for clarity, punctuation, grammar, spelling, usage, and corporate voice. I also added a few links (mostly to Javadoc). Further changes to account for changes made while I was working Someone made changes to a few paragraphs, so I edited the changed material, too. * Fix "One Sentence per Line" violations
1 parent 18836db commit 84a7a70

File tree

10 files changed

+1265
-826
lines changed

10 files changed

+1265
-826
lines changed

src/reference/asciidoc/appendix.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[[deps-for-21x]]
22
== Override Dependencies to use the 2.1.x kafka-clients with an Embedded Broker
33

4-
When using `spring-kafka-test` (version 2.2.x) with the 2.1.x `kafka-clients` jar, you will need to override certain transitive dependencies as follows:
4+
When you use `spring-kafka-test` (version 2.2.x) with the 2.1.x `kafka-clients` jar, you need to override certain transitive dependencies, as follows:
55

6+
====
67
[source, xml]
78
----
89
<dependency>
@@ -46,6 +47,7 @@ When using `spring-kafka-test` (version 2.2.x) with the 2.1.x `kafka-clients` ja
4647
<scope>test</scope>
4748
</dependency>
4849
----
50+
====
4951

5052
[appendix]
5153
[[history]]

src/reference/asciidoc/changes-since-1.0.adoc

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,69 +5,75 @@
55

66
This version requires the 1.0.0 `kafka-clients` or higher.
77

8-
NOTE: The 1.1.x client is supported, with _version 2.1.5_, but you will need to override dependencies as described in <<deps-for-11x>>.
9-
The 1.1.x client will be supported natively in _version 2.2_.
8+
NOTE: The 1.1.x client is supported with version 2.1.5, but you need to override dependencies as described in <<deps-for-11x>>.
9+
10+
// TODO: No topic marked deps-for-11x exists in any of the files in the directory that contains this file.
11+
12+
The 1.1.x client is supported natively in version 2.2.
1013

1114
==== JSON Improvements
1215

13-
The `StringJsonMessageConverter` and `JsonSerializer` now add type information in `Headers`, allowing the converter and `JsonDeserializer` to create specific types on reception, based on the message itself rather than a fixed configured type.
16+
The `StringJsonMessageConverter` and `JsonSerializer` now add type information in `Headers`, letting the converter and `JsonDeserializer` create specific types on reception, based on the message itself rather than a fixed configured type.
1417
See <<serdes>> for more information.
1518

1619

1720
==== Container Stopping Error Handlers
1821

19-
Container Error handlers are now provided for both record and batch listeners that treat any exceptions thrown by the listener as fatal; they stop the container.
22+
Container error handlers are now provided for both record and batch listeners that treat any exceptions thrown by the listener as fatal/
23+
They stop the container.
2024
See <<annotation-error-handling>> for more information.
2125

22-
==== Pausing/Resuming Containers
26+
==== Pausing and Resuming Containers
2327

24-
The listener containers now have `pause()` and `resume()` methods (since _version 2.1.3_).
28+
The listener containers now have `pause()` and `resume()` methods (since version 2.1.3).
2529
See <<pause-resume>> for more information.
2630

2731
==== Stateful Retry
2832

29-
Starting with _version 2.1.3_, stateful retry can be configured; see <<stateful-retry>> for more information.
33+
Starting with version 2.1.3, you can configure stateful retry.
34+
See <<stateful-retry>> for more information.
3035

3136
==== Client ID
3237

33-
Starting with _version 2.1.1_, it is now possible to set the `client.id` prefix on `@KafkaListener`.
34-
Previously, to customize the client id, you would need a separate consumer factory (and container factory) per listener.
35-
The prefix is suffixed with `-n` to provide unique client ids when using concurrency.
38+
Starting with version 2.1.1, you can now set the `client.id` prefix on `@KafkaListener`.
39+
Previously, to customize the client ID, you needed a separate consumer factory (and container factory) per listener.
40+
The prefix is suffixed with `-n` to provide unique client IDs when you use concurrency.
3641

3742

3843
==== Logging Offset Commits
3944

40-
By default, logging of topic offset commits is performed with the DEBUG logging level.
41-
Starting with _version 2.1.2_, there is a new property in `ContainerProperties` called `commitLogLevel` which allows you to specify the log level for these messages.
45+
By default, logging of topic offset commits is performed with the `DEBUG` logging level.
46+
Starting with version 2.1.2, a new property in `ContainerProperties` called `commitLogLevel` lets you specify the log level for these messages.
4247
See <<kafka-container>> for more information.
4348

4449
==== Default @KafkaHandler
4550

46-
Starting with _version 2.1.3_, one of the `@KafkaHandler` s on a class-level `@KafkaListener` can be designated as the default.
51+
Starting with version 2.1.3, you can designate one of the `@KafkaHandler` annotations on a class-level `@KafkaListener` as the default.
4752
See <<class-level-kafkalistener>> for more information.
4853

4954
==== ReplyingKafkaTemplate
5055

51-
Starting with _version 2.1.3_, a subclass of `KafkaTemplate` is provided to support request/reply semantics.
56+
Starting with version 2.1.3, a subclass of `KafkaTemplate` is provided to support request/reply semantics.
5257
See <<replying-template>> for more information.
5358

5459
==== ChainedKafkaTransactionManager
5560

56-
_version 2.1.3_ introduced the `ChainedKafkaTransactionManager` see <<chained-transaction-manager>> for more information.
61+
Version 2.1.3 introduced the `ChainedKafkaTransactionManager`.
62+
See <<chained-transaction-manager>> for more information.
5763

5864
==== Migration Guide from 2.0
5965

60-
https://github.com/spring-projects/spring-kafka/wiki/Spring-for-Apache-Kafka-2.0-to-2.1-Migration-Guide[2.0 to 2.1 Migration].
66+
See the https://github.com/spring-projects/spring-kafka/wiki/Spring-for-Apache-Kafka-2.0-to-2.1-Migration-Guide[2.0 to 2.1 Migration] guide.
6167

6268
=== Changes Between 1.3 and 2.0
6369

6470
==== Spring Framework and Java Versions
6571

6672
The Spring for Apache Kafka project now requires Spring Framework 5.0 and Java 8.
6773

68-
==== @KafkaListener Changes
74+
==== `@KafkaListener` Changes
6975

70-
You can now annotate `@KafkaListener` methods (and classes, and `@KafkaHandler` methods) with `@SendTo`.
76+
You can now annotate `@KafkaListener` methods (and classes and `@KafkaHandler` methods) with `@SendTo`.
7177
If the method returns a result, it is forwarded to the specified topic.
7278
See <<annotation-send-to>> for more information.
7379

@@ -76,7 +82,7 @@ See <<annotation-send-to>> for more information.
7682
Message listeners can now be aware of the `Consumer` object.
7783
See <<message-listeners>> for more information.
7884

79-
==== ConsumerAwareRebalanceListener
85+
==== Using `ConsumerAwareRebalanceListener`
8086

8187
Rebalance listeners can now access the `Consumer` object during rebalance notifications.
8288
See <<rebalance-listeners>> for more information.
@@ -85,40 +91,42 @@ See <<rebalance-listeners>> for more information.
8591

8692
==== Support for Transactions
8793

88-
The 0.11.0.0 client library added support for transactions; the `KafkaTransactionManager` and other support for transactions has been added.
94+
The 0.11.0.0 client library added support for transactions.
95+
The `KafkaTransactionManager` and other support for transactions have been added.
8996
See <<transactions>> for more information.
9097

9198
==== Support for Headers
9299

93-
The 0.11.0.0 client library added support for message headers; these can now be mapped to/from `spring-messaging` `MessageHeaders`.
100+
The 0.11.0.0 client library added support for message headers.
101+
These can now be mapped to and from `spring-messaging` `MessageHeaders`.
94102
See <<headers>> for more information.
95103

96104
==== Creating Topics
97105

98-
The 0.11.0.0 client library provides an `AdminClient` which can be used to create topics.
99-
The `KafkaAdmin` uses this client to automatically add topics defined as `@Bean` s.
106+
The 0.11.0.0 client library provides an `AdminClient`, which you can use to create topics.
107+
The `KafkaAdmin` uses this client to automatically add topics defined as `@Bean` instances.
100108

101109

102-
==== Support for Kafka timestamps
110+
==== Support for Kafka Timestamps
103111

104-
`KafkaTemplate` now supports API to add records with timestamps.
112+
`KafkaTemplate` now supports an API to add records with timestamps.
105113
New `KafkaHeaders` have been introduced regarding `timestamp` support.
106-
Also new `KafkaConditions.timestamp()` and `KafkaMatchers.hasTimestamp()` testing utilities have been added.
107-
See <<kafka-template>>, <<kafka-listener-annotation>> and <<testing>> for more details.
114+
Also, new `KafkaConditions.timestamp()` and `KafkaMatchers.hasTimestamp()` testing utilities have been added.
115+
See <<kafka-template>>, <<kafka-listener-annotation>>, and <<testing>> for more details.
108116

109-
==== @KafkaListener Changes
117+
==== `@KafkaListener` Changes
110118

111119
You can now configure a `KafkaListenerErrorHandler` to handle exceptions.
112120
See <<annotation-error-handling>> for more information.
113121

114122
By default, the `@KafkaListener` `id` property is now used as the `group.id` property, overriding the property configured in the consumer factory (if present).
115123
Further, you can explicitly configure the `groupId` on the annotation.
116-
Previously, you would have needed a separate container factory (and consumer factory) to use different `group.id` s for listeners.
124+
Previously, you would have needed a separate container factory (and consumer factory) to use different `group.id` values for listeners.
117125
To restore the previous behavior of using the factory configured `group.id`, set the `idIsGroup` property on the annotation to `false`.
118126

119-
==== @EmbeddedKafka Annotation
127+
==== `@EmbeddedKafka` Annotation
120128

121-
For convenience a test class level `@EmbeddedKafka` annotation is provided with the purpose to register `KafkaEmbedded` as a bean.
129+
For convenience, a test class-level `@EmbeddedKafka` annotation is provided, to register `KafkaEmbedded` as a bean.
122130
See <<testing>> for more information.
123131

124132
==== Kerberos Configuration
@@ -143,15 +151,15 @@ Listeners can be configured to receive the entire batch of messages returned by
143151

144152
==== Null Payloads
145153

146-
Null payloads are used to "delete" keys when using log compaction.
154+
Null payloads are used to "`delete`" keys when you use log compaction.
147155

148156
==== Initial Offset
149157

150158
When explicitly assigning partitions, you can now configure the initial offset relative to the current position for the consumer group, rather than absolute or relative to the current end.
151159

152160
==== Seek
153161

154-
You can now seek the position of each topic/partition.
155-
This can be used to set the initial position during initialization when group management is in use and Kafka assigns the partitions.
156-
You can also seek when an idle container is detected, or at any arbitrary point in your application's execution.
162+
You can now seek the position of each topic or partition.
163+
You can use this to set the initial position during initialization when group management is in use and Kafka assigns the partitions.
164+
You can also seek when an idle container is detected or at any arbitrary point in your application's execution.
157165
See <<seek>> for more information.

src/reference/asciidoc/index.adoc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
[[spring-kafka-reference]]
2-
32
= Spring for Apache Kafka
4-
53
:toc:
64

75
== Preface
@@ -18,12 +16,10 @@ include::./whats-new.adoc[]
1816
== Introduction
1917

2018
This first part of the reference documentation is a high-level overview of Spring for Apache Kafka and the underlying
21-
concepts and some code snippets that will get you up and running as quickly as possible.
19+
concepts and some code snippets that can help you get up and running as quickly as possible.
2220

2321
include::quick-tour.adoc[]
2422

25-
// include::whats-new.adoc[]
26-
2723
== Reference
2824

2925
This part of the reference documentation details the various components that comprise Spring for Apache Kafka.
@@ -37,15 +33,15 @@ include::testing.adoc[]
3733

3834
== Spring Integration
3935

40-
This part of the reference shows how to use the `spring-integration-kafka` module of Spring Integration.
36+
This part of the reference guide shows how to use the `spring-integration-kafka` module of Spring Integration.
4137

4238
include::si-kafka.adoc[]
4339

4440
[[resources]]
4541

4642
== Other Resources
4743

48-
In addition to this reference documentation, there exist a number of other resources that may help you learn about
44+
In addition to this reference documentation, we recommend a number of other resources that may help you learn about
4945
Spring and Apache Kafka.
5046

5147
- https://kafka.apache.org/[Apache Kafka Project Home Page]

0 commit comments

Comments
 (0)