Skip to content

Commit a1208fc

Browse files
authored
Merge pull request #53 from ejegg/stomp
Stomp
2 parents 7ce5ca3 + 0eb32da commit a1208fc

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/PHPQueue/Backend/Stomp.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
use FuseSource\Stomp\Stomp as FuseStomp;
55

6+
use BadMethodCallException;
67
use PHPQueue\Exception\BackendException;
78
use PHPQueue\Exception\JobNotFoundException;
89
use PHPQueue\Interfaces\FifoQueueStore;
@@ -113,7 +114,10 @@ protected function readFrame($properties = null)
113114
if ($properties === null) {
114115
$properties = array('ack' => 'client');
115116
}
116-
$this->getConnection()->subscribe($this->queue_name, $properties);
117+
$result = $this->getConnection()->subscribe($this->queue_name, $properties);
118+
if (!$result) {
119+
throw new BackendException("No response when subscribing to queue {$this->queue_name}");
120+
}
117121
if ($this->read_timeout) {
118122
$this->getConnection()->setReadTimeout($this->read_timeout);
119123
}
@@ -139,6 +143,6 @@ protected function readFrame($properties = null)
139143

140144
public function clear($key=null)
141145
{
142-
throw new Exception('Not implemented.');
146+
throw new BadMethodCallException('Not implemented.');
143147
}
144148
}

0 commit comments

Comments
 (0)