Announcement Announcement Module
No announcement yet.
AMQP with transaction manager Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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="" />
    <property name="service" ref="stbService" />
    <property name="amqpTemplate" ref="template" />

    <bean id="rabbitTxManager"
    class="org.springframework.amqp.rabbit.transaction .RabbitTransactionManager">
    <property name="connectionFactory" ref="connectionFactory" />
    <bean id="stbService" class="" />

    <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}" />

    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(
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed( :172)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(
    at com.sun.proxy.$Proxy7.isIdentityAvailableForSTB(Un known Source)
    at tv.moonweb.stb.service.api.STBServiceClient.isIden tityAvailableForSTB(
    ... 17 more

    Please help me to solve this issue

    Thankyou in advance


  • #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.



    • #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).