Results 1 to 8 of 8

Thread: Random Failures when running spring integration over amqp

  1. #1

    Default 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. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    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

  3. #3

    Default

    Quote 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?

  4. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,022

    Default

    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>
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  5. #5

    Default

    Quote 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

  6. #6
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,022

    Default

    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.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  7. #7
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,022

    Default

    E.g. to increase to 10 seconds...

    Code:
    	<rabbit:template id="amqpTemplate" connection-factory= ... reply-timeout="10000" />
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  8. #8

    Default

    Quote 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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •