Announcement Announcement Module
Collapse
No announcement yet.
stateful retry Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • stateful retry

    my configuration looks like this.

    Code:
    <bean id="myntraMessageKeyGenerator" class="x.y.MyntraMessageKeyGenerator" init-method="init" />
        
        <bean id="retryInterceptor" class="org.springframework.amqp.rabbit.config.StatefulRetryOperationsInterceptorFactoryBean">
            <property name="messageRecoverer">
                <bean class="x.y.DLQMessageRecoverer" />
            </property>
            <property name="messageKeyGenerator" ref="myntraMessageKeyGenerator" />
            <property name="retryOperations" ref="retryTemplate" />
        </bean>     
        <bean id="retryTemplate" class="org.springframework.retry.support.RetryTemplate">
            <property name="backOffPolicy">
                <bean class="org.springframework.retry.backoff.ExponentialBackOffPolicy">
                    <property name="initialInterval" value="5000" />
                    <property name="maxInterval" value="120000" />
                    <property name="multiplier" value="2" />
                </bean>     
            </property>
            <property name="retryPolicy">
                <bean class="org.springframework.retry.policy.SimpleRetryPolicy">
                    <property name="maxAttempts" value="3" />
                </bean>     
            </property>
        </bean>
    but i am getting below exception..

    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.integration.amqp.outboun
    d.AmqpOutboundEndpoint#5d0ee8': Cannot resolve reference to bean 'retryInterceptor' while setting bean property 'adviceChain' with key [0]; nes
    ted exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'retryInterceptor' defined in ServletCo
    ntext resource [/WEB-INF/beans-messaging.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritableProperty
    Exception: Invalid property 'messageKeyGenerator' of bean class [org.springframework.amqp.rabbit.config.StatefulRet ryOperationsInterceptorFacto
    ryBean]: Bean property 'messageKeyGenerator' is not writable or has an invalid setter method. Did you mean 'messageKeyGeneretor'?
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:329)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:107)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveManagedList(BeanDefinit ionValueResolver.java:353)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:154)

  • #2
    Hi!
    But you have typo issue:
    Code:
    'messageKeyGenerator'.eachWithIndex { c, i ->
    	assert c == 'messageKeyGeneretor'[i] 
    }
    And it is a bug in the Spring AMQP, which was fixed in 1.2.0.M1: https://jira.springsource.org/browse/AMQP-272
    So, or upgrade to this, or use misspelled accessor yet

    Take care,
    Artem

    Comment


    • #3
      thanks man! that helped

      Comment

      Working...
      X