Technology Sharing

Remote call error timeout: java.net.SocketTimeoutException: Read timed out

2024-07-12

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

I encountered a problem when working on the Grain Mall project:

P91 talks about how, when you publish a product on the front-end page and click to save the product, the remote call service times out: java.net.SocketTimeoutException: Read timed out

Solution:

In the product's yml configuration file, add the timeout for remote call services

  1. feign:
  2. hystrix:
  3. enabled: true
  4. client:
  5. config:
  6. gulimall-coupon:
  7. connectTimeout: 5000
  8. readTimeout: 5000

After adding, restart the product application, and then re-initiate the request and find that it is successful