Announcement Announcement Module
Collapse
No announcement yet.
AMQP with transaction manager Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AMQP with transaction manager

    Hi guys,

    I am using RabbitMQ for my messaging with producer. Producer service is doing spring @transaction to handle db transaction. I copied my rpc producer side code


    <bean id="stbListener"
    class="org.springframework.amqp.remoting.service.A mqpInvokerServiceExporter">
    <property name="serviceInterface" value="com.java.stb.service.api.STBService" />
    <property name="service" ref="stbService" />
    <property name="amqpTemplate" ref="template" />
    </bean>


    <bean id="rabbitTxManager"
    class="org.springframework.amqp.rabbit.transaction .RabbitTransactionManager">
    <property name="connectionFactory" ref="connectionFactory" />
    </bean>
    <bean id="stbService" class="com.java.stb.service.impl.STBServiceImpl" />

    <rabbit:connection-factory id="connectionFactory"
    channel-cache-size="10" />
    <rabbit:admin connection-factory="connectionFactory"
    auto-startup="false" />
    <rabbit:template id="template" connection-factory="connectionFactory"
    channel-transacted="true" />

    <rabbit:queue name="${queue}" />

    <rabbit:listener-container concurrency="20" prefetch="20" transaction-size="10" auto-startup="false"
    connection-factory="connectionFactory" transaction-manager="rabbitTxManager">
    <rabbit:listener ref="stbListener" queue-names="${queue}" />
    </rabbit:listener-container>


    When i run my service i am getting timeout exception which is

    Caused by: org.springframework.remoting.RemoteProxyFailureExc eption: No reply received - perhaps a timeout in the template?
    at org.springframework.amqp.remoting.client.AmqpClien tInterceptor.invoke(AmqpClientInterceptor.java:60)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
    at com.sun.proxy.$Proxy7.isIdentityAvailableForSTB(Un known Source)
    at tv.moonweb.stb.service.api.STBServiceClient.isIden tityAvailableForSTB(STBServiceClient.java:101)
    ... 17 more


    Please help me to solve this issue

    Thankyou in advance

    Gopy

  • #2
    Sorry for not getting to this sooner. We are in the process of moving to StackOverflow for our forums.

    This question is probably a better candidate for StackOverflow, perhaps against the #spring-amqp tag.
    If you do post it there, please reply here with the link.

    Thanks!

    Comment


    • #3
      But, to answer quickly, it appears you are using the AmqpProxyFactoryBean and you need to increase it's RabbitTemplate's replyTimeout property (the default is 5 seconds).

      Comment

      Working...
      X