You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a situation where the payload gets empty when the message under went the conversion.
Note: The payload comes as a List Payload:
[payload=[{"recordHeader": {"producerId": "67bef361-8d47-497a-b670-cf7839e2b4a1", "producedAt": {"epoch_millis": 1707716860875}, "correlationId": "11"}, "customer": {"id": "12345", "memberCustomerId": null}}], headers={kafka_offset=[1304], kafka_conversionFailures=[], kafka_consumer=org.apache.kafka.clients.consumer.KafkaConsumer@51e0350c, kafka_timestampType=[CREATE_TIME], kafka_receivedPartitionId=[4], kafka_receivedMessageKey=[8012008], kafka_batchConvertedHeaders=[{X-Custom-Header=[B@3d914a96}], kafka_receivedTopic=[topic1], kafka_receivedTimestamp=[1707716860875], contentType=application/*+avro, kafka_groupId=local-group}]
In Spring Messaging payload of null is not allowed. In other words we can never have payload as null, hence the null check.
It is not quite clear from your issue if what you expected is a null payload, but if you did here is your answer. And if so what is the problem with empty list? You can do a check inside the function and act etc. . .
This sounds like the same issue as: #1112
You might want to check the 2 workarounds described on that issue and see whether they can be applied for your use case.
I have a situation where the payload gets empty when the message under went the conversion.
Note: The payload comes as a List
Payload:
[payload=[{"recordHeader": {"producerId": "67bef361-8d47-497a-b670-cf7839e2b4a1", "producedAt": {"epoch_millis": 1707716860875}, "correlationId": "11"}, "customer": {"id": "12345", "memberCustomerId": null}}], headers={kafka_offset=[1304], kafka_conversionFailures=[], kafka_consumer=org.apache.kafka.clients.consumer.KafkaConsumer@51e0350c, kafka_timestampType=[CREATE_TIME], kafka_receivedPartitionId=[4], kafka_receivedMessageKey=[8012008], kafka_batchConvertedHeaders=[{X-Custom-Header=[B@3d914a96}], kafka_receivedTopic=[topic1], kafka_receivedTimestamp=[1707716860875], contentType=application/*+avro, kafka_groupId=local-group}]
The message gets deserialised and comes to the
SimpleFunctionRegistry.java#L1356
it goes to
SmartCompositeMessageConverter.java#L84
which returns an empty list when no converter found.
Falling back to
SimpleFunctionRegistry.java#L136
it checks just convertedInput == null . however, not if the list is empty hence the payload to be removed form the message when coming to the consumer
Im using
Spring boot: 3.1.8
spring-cloud-function-context: 4.1.0
The text was updated successfully, but these errors were encountered: