Announcement Announcement Module
Collapse
No announcement yet.
Endpoint assigned to the defaultError Channel not getting messages Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Endpoint assigned to the defaultError Channel not getting messages

    Hi,

    I have wired an endpoint to the default errorChannel bean. I must have the wrong kind of endpoint or a misconfiguration, because my endpoint doesn't get invoked to do the error handling.

    I also have a question about best practices for configuring channels with taskExecutors. Namely, is it bad practice to define multiple channels and wire in a reference to the same task executor bean to each of the channels?

    Here is my configuration.

    (I use the default errorChannel bean defined in the application context)

    <integration:service-activator input-channel="errorChannel"
    ref="flowExceptionHandler"
    method="onException"/>

  • #2
    Is your flow sync or async, since the error message will only be dispatched to the error channel is the flow is async, otherwise exception is re-thrown back to the caller.

    Comment


    • #3
      Originally posted by ddo View Post
      Hi,
      I also have a question about best practices for configuring channels with taskExecutors. Namely, is it bad practice to define multiple channels and wire in a reference to the same task executor bean to each of the channels?
      No definitely not. It's a good idea to keep the number of threadpools small so you can keep track of the number of running threads. Sometimes you need to split the pool to be able avoid starvation, but that's not something you want to do up front.

      Comment


      • #4
        @oleg - the ouput-channel is async but the input channel of the endpoint that triggers the exception is blocking. sounds like i need to be consistent in my usage and understand how the scope works a bit better. thanks.

        @iwein - thanks for the info. i'm using the simpleAsyncExecutor for my prototyping and will use thread pools later on when I get ready to start making this production ready. I'll have a bunch of small and well-tuned thread pools.

        Comment


        • #5
          @iwein - i meant, "i'll have a small number of thread pools that are well-tuned."

          Comment


          • #6
            Oleg,

            I started using a non-blocking channel for my endpoint that throws the exception. I get the same behavior as I described in my original post.

            I used the errorhandling tutorial as my boilerplate. Here is my configuration and the signature of my service method and my error handler:

            MY ENDPOINT CONFIG:

            <integration:channel id="asyncOutbound">
            <integration:dispatcher task-executor="asyncTaskExecutor"/>
            </integration:channel>

            <!-- The endpoint that throws the exception: -->
            <integration:transformer id="resMsgToHtng2009ATransformer"
            ref="htng2009AMessageAdapter"
            input-channel="asyncOutbound"
            output-channel="outboundStubChannel"
            method="doBindExternal"/>

            <integration:service-activator input-channel="errorChannel"
            ref="flowExceptionHandler"
            method="onException"/>

            THE SIGNATURE OF THE SERVICE METHOD (That throws the exception):

            public ReservationMessageWrapper doBindExternal(ReservationMessageWrapper reservationMessage) { ... }

            SIGNATURE OF MY EXCEPTION HANDLER:

            @ServiceActivator
            public void onException(ErrorMessage errorMessage) { ... }

            Any help would be greatly appreciated.

            Comment

            Working...
            X