spring-cloud / spring-cloud-stream

Framework for building Event-Driven Microservices
http://cloud.spring.io/spring-cloud-stream
Apache License 2.0
1.01k stars 614 forks source link

stream bridge consumer class not consuming on 2023.0.3 #2993

Closed SanzarRehman closed 3 months ago

SanzarRehman commented 3 months ago

Describe the bug Serialization is not working on 2023.0.3 , same code working on 2023.0.2

Sample Getting this error

stream bridge consumer class [B cannot be cast to class com.b.notificatoin.client.SmsNotification ([B is in module java.base of loader 'bootstrap'; com.b.notificatoin.client.SmsNotification is in unnamed module of loader 'app')

@Bean public Consumer<SmsNotification> sms() { return sms -> { log.debug("[SMS Consumer]: " + sms.getKey()); }; }

olegz commented 3 months ago

There is not enough information for us to diagnose especially since StreamBridge is sending message out to a messaging destination and your consumer is retrieving it from such destination. So effectively your consumer has nothing to do with StreamBridge. Please provide a sample test/application that reproduces the issue you are describing

SanzarRehman commented 3 months ago

similar issue found #2977

@Bean public JsonMessageConverter customJsonMessageConverter(ObjectMapper objectMapper) { return new JsonMessageConverter(new JacksonMapper(objectMapper)); }

Working with this bean . There is nothing wrong with producer . 
olegz commented 3 months ago

And if you read last comment on that issue, that particular issue has been addressed and I am just waiting for the user to confirm so I can close it That said, neither of the issues has anything to do with StreamBridge.