| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function getApiQueueStatus() |
||
| 40 | { |
||
| 41 | if (!class_exists(GuzzleClient::class)) { |
||
| 42 | throw new MonitoringException( |
||
| 43 | 'The guzzle http client library is required to run rabbitmq health checks. ' |
||
| 44 | .'Make sure to add guzzlehttp/guzzle to your composer.json.' |
||
| 45 | ); |
||
| 46 | } |
||
| 47 | |||
| 48 | $client = new GuzzleClient(); |
||
| 49 | $client->setConfig(['curl.options' => [CURLOPT_CONNECTTIMEOUT_MS => 3000]]); |
||
| 50 | $request = $client->get(sprintf('%s/queues', $this->settings['console_url'])); |
||
| 51 | $request->setAuth($this->settings['user'], $this->settings['pass']); |
||
| 52 | |||
| 53 | return json_decode($request->send()->getBody(true), true); |
||
| 54 | } |
||
| 55 | } |
||
| 56 |