Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.3K
Views
Why do I get `Only one connection receive subscriber allowed` when the response has an HTTP error status code?

Within a rest request I send another request to a webservice using Spring WebClient and want to return the result to the caller:

return webClient.post()
  .uri(url)
  .body(...)
  .retrieve()
  .bodyToMono(String::class.java)
  .map { ResponseEntity.ok(it) }

Now it that webservice returns a HTTP error status code I receive the following error:

java.lang.IllegalStateException: Only one connection receive subscriber allowed.

When a status 200 code is returned, no error is thrown.

I also tried checking the status and throwing an exception myself, but the behavior is still the same:

return webClient.post()
  .uri(url)
  .body(...)
  .retrieve()
  .onStatus(HttpStatus::isError) { clientResonse ->
     clientResonse.bodyToMono(String::class.java)
        .map { RuntimeException(it) }
  }
  .bodyToMono(String::class.java)
  .map { ResponseEntity.ok(it) }

What am I doing wrong?

The code samples are in Kotlin but I assume every Java dev can read it :)

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

This is a known issue in Spring Framework and it's been fixed in Spring Framework 5.1.4 - see SPR-17564.

Unfortunately, I'm not aware of any workaround for this problem, so upgrading to Spring Framework 5.1.4 / Spring Boot 2.1.2 is the only solution so far.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!