question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Retry http POST sent without body

See original GitHub issue

Hi, Using ribbon’s retry policy works perfect with GET requests. However, for http POST, after failing the first try for routing, the request is sent without the body.

After debugging the code, the second request (HttpRequest object in AbstractLoadBalancerAwareClient.executeWithLoadBalancer) has the same “entity” object (ServletInputStreamWrapper). Since this entity was read in the first try, its index now pointing to the end of stream, resulting in an empty body transferred to the inner microservice.

Is this a bug or improper use/configuration ?

my configuration:

ribbon:
  OkToRetryOnAllOperations: true
zuul:
    microservice:
      path: /microservice/**
      serviceId: microservice
      retryable: true

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
ksolovyovcommented, Jan 26, 2016

Hi guys, what workaround did you use? Could you please describe if you have time? Thanks.

0reactions
spencergibbcommented, Sep 13, 2016

Conversations about Spring Cloud aren’t appropriate here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to retry HTTP POST requests - Stack Overflow
1 Answer 1 ... To be able to reuse a request whose body is non-nil, you first need to make sure that the...
Read more >
How Linkerd retries HTTP requests with bodies
Retrying a request with a body may sound simple (just send the body again, right?), but it's not that straightforward. In order to...
Read more >
Retry a request until it succeeds. - R-Project.org
FALSE : No body. This is typically not used with POST , PUT , or PATCH , but can be useful if you...
Read more >
Retry a request until it succeeds. - httr
FALSE : No body. This is typically not used with POST , PUT , or PATCH , but can be useful if you...
Read more >
HTTP/1.1: Header Field Definitions
If an Accept-Charset header is present, and if the server cannot send a response ... If no Accept-Encoding field is present in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found