Skip to content

Commit e600fb9

Browse files
author
luisgomez29
committed
docs: update for Spring Boot 4 and Jackson 3 migration
1 parent 21af0a1 commit e600fb9

File tree

8 files changed

+253
-2618
lines changed

8 files changed

+253
-2618
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# CloudEvents JSON Jackson Module
2+
3+
This module was obtained from the official CloudEvents SDK Java repository at [https://github.com/cloudevents/sdk-java/blob/main/formats/json-jackson/](https://github.com/cloudevents/sdk-java/blob/main/formats/json-jackson/).
4+
5+
## Changes from Original
6+
7+
- Support limited to CloudEvents specification version 1.0
8+
- Updated dependencies from Jackson 2.x to Jackson 3.x
9+
- Adapted for compatibility with the reactive-commons-java project
10+

docs/docs/migration-guides.md

Lines changed: 76 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,45 @@ sidebar_position: 4
44

55
# Migration
66

7+
## From 6.x.x to 7.x.x
8+
9+
### Change notes
10+
11+
- Upgrade to Spring Boot 4 and Jackson 3.
12+
13+
### Actions
14+
15+
#### 1. Update Jackson imports
16+
17+
If you have custom code using Jackson, update the imports from `com.fasterxml.jackson.*` to `tools.jackson.*`.
18+
19+
**Before (Jackson 2):**
20+
21+
```java
22+
import com.fasterxml.jackson.databind.ObjectMapper;
23+
import com.fasterxml.jackson.databind.JsonNode;
24+
import com.fasterxml.jackson.core.type.TypeReference;
25+
```
26+
27+
**After (Jackson 3):**
28+
29+
```java
30+
import tools.jackson.databind.ObjectMapper;
31+
import tools.jackson.databind.JsonNode;
32+
import tools.jackson.core.type.TypeReference;
33+
```
34+
35+
#### 2. Remove CloudEvents Jackson dependency
36+
37+
If you were using CloudEvents, **remove** the `cloudevents-json-jackson` dependency as it only supports Jackson 2. A built-in module now provides Jackson 3 support for CloudEvents.
38+
39+
```groovy
40+
// Remove this dependency
41+
implementation 'io.cloudevents:cloudevents-json-jackson:<version>'
42+
```
43+
44+
---
45+
746
## From 5.x.x to 6.x.x
847

948
### New features
@@ -32,17 +71,22 @@ public ConnectionFactoryCustomizer connectionFactoryCustomizer() {
3271

3372
### Actions
3473

35-
- If your application uses the ReqReply pattern, you must explicitly set `app.async.app.listenReplies` to `true`.
36-
Otherwise, it should be `false` to avoid unnecessary resource usage:
74+
#### 1. Configure listenReplies property
75+
76+
If your application uses the ReqReply pattern, you must explicitly set `app.async.app.listenReplies` to `true`. Otherwise, it should be `false` to avoid unnecessary resource usage.
3777

38-
```yaml title="application.yaml"
78+
**YAML Configuration:**
79+
80+
```yaml
3981
app:
4082
async:
4183
app:
4284
listenReplies: true # set to true if ReqReply is required, false if not
4385
```
4486
45-
```java title="Programmatic configuration"
87+
**Programmatic Configuration:**
88+
89+
```java
4690
@Configuration
4791
public class MyDomainConfig {
4892

@@ -61,18 +105,22 @@ public class MyDomainConfig {
61105
}
62106
```
63107

64-
---
108+
#### 2. Define the app domain
65109

66-
- The domain `app` must be defined in your configuration. Otherwise, the application will throw an exception at startup:
110+
The domain `app` must be defined in your configuration. Otherwise, the application will throw an exception at startup.
67111

68-
```yaml title="application.yaml"
112+
**YAML Configuration:**
113+
114+
```yaml
69115
app:
70116
async:
71117
app: # Configure the 'app' domain
72118
# domain configuration goes here
73119
```
74120

75-
```java title="Programmatic configuration"
121+
**Programmatic Configuration:**
122+
123+
```java
76124
@Configuration
77125
public class MyDomainConfig {
78126

@@ -90,6 +138,8 @@ public class MyDomainConfig {
90138
}
91139
```
92140

141+
---
142+
93143
## From 4.x.x to 5.x.x
94144

95145
### New features
@@ -107,21 +157,23 @@ public class MyDomainConfig {
107157

108158
### Actions
109159

110-
- The `app` domain needs to be defined to specify the configuration properties.
160+
#### 1. Update domain configuration structure
161+
162+
The `app` domain needs to be defined to specify the configuration properties.
111163

112-
Before:
164+
**Before:**
113165

114-
```yaml title="application.yaml"
166+
```yaml
115167
app:
116168
async:
117169
withDLQRetry: true
118170
maxRetries: 1
119171
retryDelay: 1000
120172
```
121173
122-
Now:
174+
**After:**
123175
124-
```yaml title="application.yaml"
176+
```yaml
125177
app:
126178
async:
127179
app: # this is the name of the default domain
@@ -130,9 +182,11 @@ app:
130182
retryDelay: 1000
131183
```
132184
133-
- Migrate the connection configuration:
185+
#### 2. Migrate connection configuration
134186
135-
Before: the connection was defined manually in a Java class, as shown below:
187+
**Before:**
188+
189+
The connection was defined manually in a Java class:
136190
137191
```java
138192
@Log4j2
@@ -171,9 +225,11 @@ public class MyDomainConfig {
171225
}
172226
```
173227

174-
Now: the connection is configured directly in the `application.yaml` file per domain:
228+
**After:**
229+
230+
The connection is configured directly in the `application.yaml` file per domain:
175231

176-
```yaml title="application.yaml"
232+
```yaml
177233
app:
178234
async:
179235
app: # this is the name of the default domain
@@ -193,9 +249,11 @@ app:
193249
virtual-host: /accounts
194250
```
195251
252+
**Alternative - Programmatic Configuration:**
253+
196254
Domains can also be configured programmatically:
197255
198-
```java title="Programmatic configuration"
256+
```java
199257
@Configuration
200258
public class MyDomainConfig {
201259

docs/docs/reactive-commons/1-getting-started.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Commons.
1515

1616
## Requirements
1717

18-
You need Java JRE installed (Java 17 or later).
18+
You need Java JRE installed (Java 17 or later) and Spring Boot 4.
1919

2020
You also need to install RabbitMQ. Follow the [instructions from the website](https://www.rabbitmq.com/download.html).
2121

@@ -54,7 +54,7 @@ dependencies {
5454
If you will use Cloud Events, you should include the Cloud Events dependency:
5555
```groovy
5656
dependencies {
57-
implementation 'io.cloudevents:cloudevents-json-jackson:4.0.1'
57+
implementation 'io.cloudevents:cloudevents-core:4.0.1'
5858
}
5959
```
6060
:::
@@ -139,7 +139,7 @@ Commons.
139139

140140
## Requirements
141141

142-
You need Java JRE installed (Java 17 or later).
142+
You need Java JRE installed (Java 17 or later) and Spring Boot 4.
143143

144144
## Start Kafka
145145

@@ -224,8 +224,7 @@ dependencies {
224224
If you will use Cloud Events, you should include the Cloud Events dependency:
225225
```groovy
226226
dependencies {
227-
implementation 'io.cloudevents:cloudevents-json-jackson:4.0.1'
228-
}
227+
implementation 'io.cloudevents:cloudevents-core:4.0.1'
229228
```
230229
:::
231230

docs/docs/reactive-commons/10-wildcards.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ example:
3737
```java
3838

3939
@Component
40-
@AllArgsConstructor
40+
@RequiredArgsConstructor
4141
public class DynamicSubscriber {
4242
private final DynamicRegistry registry;
4343

docs/docs/reactive-commons/11-creating-a-cloud-event.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ In order to instantiate a CloudEvent you may need to include the dependencies:
1616

1717
```groovy
1818
implementation 'io.cloudevents:cloudevents-core:<version>'
19-
// or
20-
implementation 'io.cloudevents:cloudevents-json-jackson:<version>'
2119
```
2220

2321
## Creating a CloudEvent instance with our Data wrapper
@@ -65,7 +63,7 @@ add this classes:
6563
import io.cloudevents.core.builder.CloudEventBuilder;
6664
import io.cloudevents.CloudEvent;
6765
import io.cloudevents.jackson.JsonCloudEventData;
68-
import com.fasterxml.jackson.databind.ObjectMapper;
66+
import tools.jackson.databind.ObjectMapper;
6967
```
7068

7169
```java

docs/docs/reactive-commons/configuration_properties/1-rabbitmq.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,6 @@ Therefore, it is recommended to verify or create the queue beforehand to ensure
443443
```java
444444
package sample;
445445
446-
import com.fasterxml.jackson.core.type.TypeReference;
447-
import com.fasterxml.jackson.databind.JsonNode;
448-
import com.fasterxml.jackson.databind.ObjectMapper;
449446
import org.reactivecommons.api.domain.Command;
450447
import org.reactivecommons.async.api.DirectAsyncGateway;
451448
import org.reactivecommons.async.impl.config.annotations.EnableDirectAsyncGateway;
@@ -456,6 +453,9 @@ import org.springframework.stereotype.Component;
456453
import reactor.core.publisher.Mono;
457454
import reactor.rabbitmq.OutboundMessage;
458455
import reactor.rabbitmq.OutboundMessageResult;
456+
import tools.jackson.core.type.TypeReference;
457+
import tools.jackson.databind.JsonNode;
458+
import tools.jackson.databind.ObjectMapper;
459459
460460
@Component
461461
@EnableDirectAsyncGateway

0 commit comments

Comments
 (0)