You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our implementation class should use STOMP, and will essentially look like this:
$queue = '/queue/foo';
$msg = 'bar';
/* connection */try {
$stomp = newStomp('tcp://localhost:61613');
} catch(StompException$e) {
die('Connection failed: ' . $e->getMessage());
}
/* send a message to the queue 'foo' */$stomp->send($queue, $msg);
/* close connection */
unset($stomp);
We'll need to write a Kernel test for this service, pulling it out of the dependency injection container, publishing a message with our publish function, and then reading from the queue to see if the message has been received. You can check for a message using code like this:
$queue = '/queue/foo';
$msg = 'bar';
/* connection */try {
$stomp = newStomp('tcp://localhost:61613');
} catch(StompException$e) {
die('Connection failed: ' . $e->getMessage());
}
/* subscribe to messages from the queue 'foo' */$stomp->subscribe($queue);
/* read a frame */$frame = $stomp->readFrame();
$this->assertTrue($frame->body == $msg, "Queue must contain sent message");
unset($stomp);
The only caveat here is that the broker url will come from the islandora module's configuration.
The text was updated successfully, but these errors were encountered:
So.... turns out the php stomp pecl extension is not supported in php7. So I need to use this: https://github.com/stomp-php/stomp-php. Which is good. It knows to block until a message has been received and handles things a bit nicer. But it's on packagist. So we need to start using composer, which leads to a lot of big changes. Like #474 and #475
Depends on #466
We need to create a service to publish messages from Drupal. It should have a basic interface
Our implementation class should use STOMP, and will essentially look like this:
We'll need to write a Kernel test for this service, pulling it out of the dependency injection container, publishing a message with our
publish
function, and then reading from the queue to see if the message has been received. You can check for a message using code like this:The only caveat here is that the broker url will come from the islandora module's configuration.
The text was updated successfully, but these errors were encountered: