7 declare(strict_types=1);
26 private $host =
'http://localhost:15672/api/';
33 $this->curl =
new Curl();
34 $this->curl->setCredentials(
'guest',
'guest');
35 $this->curl->addHeader(
'content-type',
'application/json');
45 $this->curl->get($this->host .
'exchanges');
46 $data = $this->curl->getBody();
62 $this->curl->get($this->host .
'exchanges/%2f/' .
$name .
'/bindings/source');
63 $data = $this->curl->getBody();
64 return json_decode(
$data,
true);
74 $this->curl->get($this->host .
'connections');
75 $data = $this->curl->getBody();
92 "count" => $numMessages,
93 "ackmode" =>
"ack_requeue_false",
97 $this->curl->post($this->host .
'queue/%2f/' .
$name .
'/get', json_encode($body));
98 return $this->curl->getBody();
109 $this->curl->delete($this->host .
'conections/' . urlencode(
$name));
110 $data = $this->curl->getBody();
clearQueue(string $name, int $numMessages=50)
getExchangeBindings($name)
if(!isset($_GET['name'])) $name