Spring CloudEventMessageConverter content-type header name

Đang mở
#680 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java, kafka, spring
Lĩnh vực
backend

Hướng nghiên cứu

Xác định code Spring CloudEventMessageConverter trong sdk-spring và kiểm tra cách nó đọc các header content-type. Xác minh tương tác giữa serializer và deserializer được mô tả trong issue, đồng thời giữ nguyên các fallback hiện có trong khi hỗ trợ tên header theo đặc tả CloudEvents; hoàn thành khi các message có cấu trúc từ sdk-kafka được deserialize qua sdk-spring.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Spring CloudEventMessageConverter content-type header name uses the Spring Messaging contentType header name which differs fom the cloud events spec content-type which is used by Kafka serializer for instance.

This leads to a message from a project using structured mode and kafka serializer (sdk-kafka) to not be deserialized by another project using (sdk-spring).

The current code is as follows on sdk-spring:

        if (message.containsKey(MessageHeaders.CONTENT_TYPE)) {
            return String.valueOf(message.get(MessageHeaders.CONTENT_TYPE));
        }
        if (message.containsKey(CloudEventsHeaders.CONTENT_TYPE)) {
            return String.valueOf(message.get(CloudEventsHeaders.CONTENT_TYPE));
        }

Unfortunately the CloudEventsHeaders.CONTENT_TYPE is CE_PREFIX + "datacontenttype" which is not exactly the same property we are looking here.

I would be happy to create a merge request where a another fallback is introduced to have the spec header name (content-type) which would enable the sdk-spring to deserialize messages.

This would add the support while still keeping it compatible with different versions and services.

Ideally, also the spring-sdk serializer should be checked and changed, but i would rather have this small mr fixed and dive on the serializer in a different issue.

Ngôn ngữ chính
Java
Star
446
Fork
172
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cloudevents/sdk-java

Tất cả issue của cloudevents/sdk-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.