Announcement Announcement Module
No announcement yet.
Timeouts and GatewayProxyFactoryBean Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Timeouts and GatewayProxyFactoryBean

    Can the GatewayProxyFactoryBean return a null response if the request timed out? Similar to the MessageChannelTemplate. Before the response message gets to the responseChannel I have a interceptor which checks if the message is valid or not, and if its invalid I have it return null to prevent further processing. I then expect the responseChannel to time out if the interceptor has prevented the further processing and the gateway to return null. Am I doing this correctly?

    Message<?> response = gateway.sendMessage(request);
    can the message payload here ever be null here?

    <gateway id="InBoundGateway"
    service-interface=" sMessageGateway"

  • #2
    I tried it with the MessageChannelTemplate also I am not receiving any null. It looks like it just stops the thread after interceptor returns null. I'm guessing this isn't the way I should be doing this. I want the interceptor to decide if a message needs to be delivered else return null. so the sender will know it didnt go through. Should I be using a filter instead? I think it basically uses the same logic. Any suggestions please?


    • #3
      In general, the Filter sounds like a better solution for Message validation. Another option might be to have your channel interceptor throw an Exception. I guess you want to avoid that and just have a null return in either case: invalid message or no message available. There is no need to make a distinction in your app?