Results 1 to 4 of 4

Thread: Throwing Exception through payload-type-router

  1. #1
    Join Date
    Apr 2011
    Posts
    27

    Default Throwing Exception through payload-type-router

    I have a <gateway> custom channel that is picking up events and is passing them down a channel to a <chain>, when an exception is thrown somewhere in the <chain> it is correctly being passed back to the <gateway error-channel="..." > and that all works fine.

    So far so good ...

    However when I put a <payload-type-router > in-between the <gateway .. > and the <chain ... > to route the messages from the <gateway ... > to more than one <chain ... > THEN when I throw the same exception from the chain the exception dissappears !!

    So the question is what config am I supposed to use to ensure that an exception is correctly handled when passing from a <payload-type-router > to a <chain>?

  2. #2
    Join Date
    Apr 2011
    Posts
    27

    Default Strange

    I take that back it seems to have worked .. not sure what I did ...

    It would nice to have confirmation that exceptions are thrown back through routers?

  3. #3
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Robin

    Its more then that. Exceptions are always thrown back to the entry point of the flow *unless* they are somehow intercepted.
    The typical entry points are:
    1. Inbound Gateway (e.g., proxy, http, jms etc.)
    2. Pollers

    In the case of the gateway such as <int:gateway> where you simply invoke a method the downstream exception is thrown back at the caller *unless* you define an error-channel which give you the capability to intercept an exception and deal with it (sort of 'catch' block). And of HTTP (as an example) it will result to some 500 error *unless* it was intercepted via the error-channel and dealt with.
    Pollers are similar

    EventBasedConsumers do not have capability to trap and swallow the exception. That would be a serious bug on our end. So PayloadTypeRouter is not swallowing any exception. What i was going to suggest is that may be it didn't really route anywhere because of the wrong payload, but it seem like you got it figured out.
    Cheers

  4. #4
    Join Date
    Apr 2011
    Posts
    27

    Default

    Thanks, it is all working for me.

Posting Permissions

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