Skip to content

Commit 93a82b7

Browse files
committed
Simplify CloudEvent formatting with SDK strategies
Replace custom CloudEvent converter infrastructure with direct CloudEvents SDK format implementations. Key changes: - Replace `FormatStrategy` pattern-based approach with direct `EventFormatProvider` integration from CloudEvents SDK - Remove custom converter classes (`CloudEventMessageConverter`, `MessageBinaryMessageReader`, `MessageBuilderMessageWriter`) - Simplify transformer to use Expression-based configuration for all CloudEvent attributes (id, source, type, dataSchema, subject) - Add validation for required CloudEvent attributes with clear error messages when expressions evaluate to null or empty values - Update documentation to reflect Expression-based API and byte[] payload requirement - Consolidate tests by removing coverage for deleted converter infrastructure
1 parent 19b057a commit 93a82b7

File tree

16 files changed

+411
-1405
lines changed

16 files changed

+411
-1405
lines changed

build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,15 @@ project('spring-integration-cloudevents') {
492492

493493
dependencies {
494494
api "io.cloudevents:cloudevents-core:$cloudEventsVersion"
495+
optionalApi "io.cloudevents:cloudevents-spring:$cloudEventsVersion"
496+
optionalApi "io.cloudevents:cloudevents-json-jackson:$cloudEventsVersion"
497+
498+
optionalApi("io.cloudevents:cloudevents-avro-compact:$cloudEventsVersion") {
499+
exclude group: 'org.apache.avro', module: 'avro'
500+
}
501+
optionalApi "org.apache.avro:avro:$avroVersion"
502+
optionalApi "io.cloudevents:cloudevents-xml:$cloudEventsVersion"
503+
testImplementation 'tools.jackson.core:jackson-databind'
495504
}
496505
}
497506

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
/*
3+
* Copyright 2025-present the original author or authors.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
@org.jspecify.annotations.NullMarked
20+
package org.springframework.integration.cloudevents;

0 commit comments

Comments
 (0)