Results 1 to 2 of 2

Thread: Null responses

  1. #1
    Join Date
    May 2008
    Posts
    1

    Default Null responses

    I have noticed that when a service is invoked that returns a null response, the null response is not returned to the channel. I had done this in a junit test on a more complex service and the junit did not get back the null response to complete. As an example if you use the hello world example and return null, the thread will not return. What happens to the Generic Message? How is this best handled? It seems the behavior is the same on all channel implementations.

  2. #2
    Join Date
    Oct 2007
    Location
    Toronto, ON
    Posts
    90

    Default

    Hi Emilio,

    The assumption is, that a null return value indicates that there actually is nothing to return. As such, no message will be created by that handler-endpoint. If it is important to pass on a message which indicates that the service returns 'nothing', I would suggest to use the Null Object pattern (return a value which by convention means 'nothing').

    Regards,
    Marius
    Marius Bogoevici,
    Spring Integration Committer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •