Try PubSub+

null payload close the consumer flow receiver

Hi All, I am using cloud stream lib for message consuming from solace.
If the inbound message has 'null' payload, then InboundXMLMessageListener.xmlMessageMapper.map(bytesXMLMessage) throws SolaceMessageConversionException.
And as a result, it ends with "Closing flow receiver to destination ...". And no further messages are received.
Kindly suggest how can I avoid this

Comments

  • marcmarc Member, Administrator, Moderator, Employee Posts: 252 admin

    Hi @DeepakSoni12,
    Thanks for bringing this to our attention. It sounds like you may have found a bug. Is it possible for you to share your project with me? I tried to recreate this in my environment, but the app just logged "XMLMessage 28 has no payload" and continued listening for more messages. It would be useful to see how you're sending messages with a null payload as well as your receiver function (is it imperative or reactive?)

    -Marc

  • DeepakSoni12DeepakSoni12 Member Posts: 3

    Hi @marc ,
    Thank you very much for your reply.
    1. I am publishing the messages with a null payload via postman. (to http://localhost:9000/TOPIC/sensor/temperature/asd)
    I tried to extract the code here https://github.com/deepaksoni12/solace_demo/tree/develop
    Thank you
    Deepak

  • marcmarc Member, Administrator, Moderator, Employee Posts: 252 admin

    Hi @DeepakSoni12,
    Thanks for sharing that! I was able to reproduce the issue with your code and will bring it to the attention of our R&D team and see if we can eventually get it fixed. I agree that receiving a null payload in a message shouldn't cause the app to shutdown. That said, this is the old way of using Spring Cloud Stream (with @StreamListener) and starting in Spring Cloud Stream v3 it is recommended to use Spring Cloud Function to implement your apps instead. When using Spring Cloud Function this issue doesn't seem to exist and the app continue to listen for more messages. Due to the framework as a whole moving to Spring Cloud Function (which actually allows for less messaging logic in the code) and the bug not existing when using that model I would recommend using that instead.

    I have a quick Spring Cloud Stream Basics codelab here that will walk you through getting started.

  • DeepakSoni12DeepakSoni12 Member Posts: 3

    Hi @marc ,
    Thank you very much for your time.
    I will definitely have a look at Spring Cloud Function. Thanks for sharing the link.
    Greetings!

Sign In or Register to comment.