Announcement Announcement Module
Collapse
No announcement yet.
Random Failures when running spring integration over amqp Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Random Failures when running spring integration over amqp

    Hi,

    I have a weird thing happening. I am using gateways over amqp on both ends (client and server). It seems that when my response is big, it fails randomly. I see that the message is being handled on the server side and I see the correct value returning every time. But for some reason, sometimes it returns to the client successfully and sometimes it just doesn't return.

    Any suggestions?
    Thanks
    Netta

  • #2
    When you say you see the correct value returning every time, are you referring to server side logging? Also, can you provide any client-side logging excerpts? If you can provide those as well as a simple example that demonstrates the behavior, that would be very helpful for some further investigation.

    Thanks,
    Mark

    Comment


    • #3
      Originally posted by Mark Fisher View Post
      When you say you see the correct value returning every time, are you referring to server side logging? Also, can you provide any client-side logging excerpts? If you can provide those as well as a simple example that demonstrates the behavior, that would be very helpful for some further investigation.

      Thanks,
      Mark
      What I'm seeing is a temp queue being created for the response. The problem is that sometimes, this queue isn't created at all and during those times, the answer is not received by the client.

      To answer your question, yes, the correct answer is from the server.

      What exactly would you like to see? The spring integration xmls for client server?

      Comment


      • #4
        Are you saying there is a replyTo header on the server with a generated queue name, but that queue was never created? The reason I ask is that the replyTo queue name is generated as a result of declaring the queue.

        Is it possible the client is timing out before the response is received? In that case, the reply queue will be deleted. The default reply timeout is 5 seconds, but it can be increased using the replyTimeout property on the RabbitTemplate.

        Also, the recent spring-amqp 1.1.0 release supports a fixed reply queue, which should work out of the box when the producer and consumer are both Spring Integration applications.

        Code:
        	<rabbit:template id="withReplyQ" connection-factory="connectionFactory" reply-queue="reply.queue">
        		<rabbit:reply-listener />
        	</rabbit:template>

        Comment


        • #5
          Originally posted by Gary Russell View Post
          Are you saying there is a replyTo header on the server with a generated queue name, but that queue was never created? The reason I ask is that the replyTo queue name is generated as a result of declaring the queue.

          Is it possible the client is timing out before the response is received? In that case, the reply queue will be deleted. The default reply timeout is 5 seconds, but it can be increased using the replyTimeout property on the RabbitTemplate.

          Also, the recent spring-amqp 1.1.0 release supports a fixed reply queue, which should work out of the box when the producer and consumer are both Spring Integration applications.

          Code:
          	<rabbit:template id="withReplyQ" connection-factory="connectionFactory" reply-queue="reply.queue">
          		<rabbit:reply-listener />
          	</rabbit:template>
          If I'm using amqp:gateway on both sides, the response from the server is generated sent via a default queue correct? Where is this default queue created? The reply-queue on rabbit:template wouldn't help me in this case correct? I am looking into the timeout factor, that could definitely be a problem. We have serious network latency at the moment. 5s is not a long time at all. I am assuming this timeout needs to be defined on the server side since it is the one generating the default queue to pass back the message to the client right? Or is it the client that generates the default queue?

          Thanks

          Comment


          • #6
            I'ts not a 'default' queue, it's a temporary queue, created for each request; it is created by the client - it's the timeout on the client that controls the lifecycle of the temporary queue.

            When the timeout occurs, the channel is closed; and the reply channel is auto-deleted at that time. So, increasing the replyTimeout on the client should solve your problem.

            Comment


            • #7
              E.g. to increase to 10 seconds...

              Code:
              	<rabbit:template id="amqpTemplate" connection-factory= ... reply-timeout="10000" />

              Comment


              • #8
                Originally posted by Gary Russell View Post
                I'ts not a 'default' queue, it's a temporary queue, created for each request; it is created by the client - it's the timeout on the client that controls the lifecycle of the temporary queue.

                When the timeout occurs, the channel is closed; and the reply channel is auto-deleted at that time. So, increasing the replyTimeout on the client should solve your problem.
                I meant temporary queue not default sorry :-). Yeah that seems to have been our problem...the server has been running for over an hour now without timeout issues.
                Thanks for the help.

                Comment

                Working...
                X