Announcement Announcement Module
Collapse
No announcement yet.
request-handler-advice-chain not recognized? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • request-handler-advice-chain not recognized?

    Hi all. So I've been trying to implement a simple example using the new advice chain feature based on the SI reference.

    Unfortunately, while the service, which simply creates a message and sends it to a service activator which then throws a MessageHandlingException, works just fine, I'm not getting any sort of retry logic, and STS isn't recognizing the <request-handler-advice-chain> element. All I get is the MessageHandlingException, when according to the reference, the task scheduler should be attempting retries.

    Here's my full context...

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans
    						http://www.springframework.org/schema/beans/spring-beans.xsd
    						http://www.springframework.org/schema/integration
    						http://www.springframework.org/schema/integration/spring-integration.xsd">
    	<int:channel id="inputChannel" />
    	<int:channel id="outputChannel">
    		<int:queue />
    	</int:channel>
    	<int:service-activator input-channel="inputChannel"
    		output-channel="outputChannel" ref="messageDestroyer">
    		<int:request-handler-advice-chain>
    			<bean
    				class="org.springframework.integration.handler.advice.RequestHandlerRetryAdvice" />
    		</int:request-handler-advice-chain>
    	</int:service-activator>
    	<bean id="messageDestroyer" class="com.cigna.examples.advice.main.MessageDestroyer" />
    </beans>
    Has anyone attempted to implement this component? I saw that there was an example of its use in the latest examples, but it seems like I've essentially done the same in terms of my context, and there shouldn't be anything wrong with my main class or my service activator bean class. I definitely have spring-integration-core in my POM as well.

    Any ideas?

    Thanks.

  • #2
    Hi!

    For a start: <request-handler-advice-chain> is avaliable in the latest Spring Integration 2.2.GA. So, please, check that you're using correct version.

    And on the matter: by which point do you think retry doesn't work? By default RequestHandlerRetryAdvice uses RetryTemplate with explicit SimpleRetryPolicy with 3 attempts.
    To see a work of RetryTemplate just switch on logging for it:
    Code:
    log4j.category.org.springframework.retry.support=TRACE
    By the way RequestHandlerRetryAdvice has a powerful ability - 'recoveryCallback'. And there is an useful implementation out of the box: ErrorMessageSendingRecoverer.

    HTH

    Take care,
    Artem

    Comment


    • #3
      Aha! I'm seeing the retries now. I definitely had the right version. I just figured the messages would show up by default. My mistake.

      Thanks for the help, and yeah, now that I can examine this I plan on trying out all of the different aspects of this component.

      Comment

      Working...
      X