Skip to content

Commit be0fa17

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 69a988a commit be0fa17

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
@@ -480,6 +480,15 @@ project('spring-integration-cloudevents') {
480480

481481
dependencies {
482482
api "io.cloudevents:cloudevents-core:$cloudEventsVersion"
483+
optionalApi "io.cloudevents:cloudevents-spring:$cloudEventsVersion"
484+
optionalApi "io.cloudevents:cloudevents-json-jackson:$cloudEventsVersion"
485+
486+
optionalApi("io.cloudevents:cloudevents-avro-compact:$cloudEventsVersion") {
487+
exclude group: 'org.apache.avro', module: 'avro'
488+
}
489+
optionalApi "org.apache.avro:avro:$avroVersion"
490+
optionalApi "io.cloudevents:cloudevents-xml:$cloudEventsVersion"
491+
testImplementation 'tools.jackson.core:jackson-databind'
483492
}
484493
}
485494

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)