use of org.eclipse.scanning.api.event.queue.QueueCommandBean in project gda-core by openGDA.
the class QueueAndRunExperimentNewQueueCommandHandler method startQueue.
/**
* Starts the new GDA9 queue by sending a {@link PauseBean} with
* <code>pause</code> set to <code>false</code>.
*/
private void startQueue() {
IEventService eventService = EventServiceHolder.getEventService();
if (eventService == null) {
throw new IllegalStateException("Event service not set - should be set by OSGi DS");
}
try (IPublisher<QueueCommandBean> publisher = eventService.createPublisher(new URI(LocalProperties.getActiveMQBrokerURI()), EventConstants.CMD_TOPIC)) {
QueueCommandBean bean = new QueueCommandBean(EventConstants.SUBMISSION_QUEUE, Command.RESUME_QUEUE);
publisher.broadcast(bean);
} catch (EventException | URISyntaxException e) {
logger.error("Cannot pause scan queue", e);
}
}
Aggregations