cloudevents / cloudevents/sdk-java
Spring CloudEventMessageConverter content-type header name
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Java
- Estrellas
- 446
- Forks
- 172
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Localiza el código de Spring CloudEventMessageConverter en sdk-spring e inspecciona cómo lee los encabezados content-type. Verifica la interacción entre el serializador y el deserializador descrita en el issue y conserva los fallbacks existentes mientras admites el nombre de encabezado de la especificación de CloudEvents; se considera terminado cuando los mensajes estructurados de sdk-kafka se deserializan a través de sdk-spring.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java, kafka, spring
- Área
- backend
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100