0

I want to achieve high availability with SolR Cloud. I need to dev a SolR PHP Client supporting node failure.

My lead is to work with guzzle RetryMiddleware and somehow keeptrack of up or down nodes.

My question is : is it a good lead ? (I'm not very familiar with Guzzle)

quazardous
  • 846
  • 10
  • 15

1 Answers1

1

I'm not familiar with Solr Cloud, but IMO if you want to create a proper client, you need to write your own middleware for Guzzle with the specific fallback logic inside.

RetryMiddleware is basically for retrying the same request after a delay period, nothing more. You cannot change the request (send it to a different node or something). That's why I think it could be only a part of the solution.

Otherwise the question is too broad at the moment.

Alexey Shokov
  • 4,775
  • 1
  • 21
  • 22
  • thx for your answer ! there is a nextHandler attribute ... OC I'll have to extend/adapt the class. So Middleware is at least the good place to hook guzzle logic ? – quazardous Aug 17 '18 at 08:30
  • Yes, middleware is the right place to hook your logic into Guzzle. Just not the default `RetryMiddleware` IMO. – Alexey Shokov Aug 17 '18 at 11:28