use of com.redhat.jenkins.plugins.ci.messaging.JMSMessagingWorker in project jms-messaging-plugin by jenkinsci.
the class CIMessageSubscriberBuilder method waitforCIMessage.
public String waitforCIMessage(Run<?, ?> build, Launcher launcher, TaskListener listener) {
JMSMessagingProvider provider = GlobalCIConfiguration.get().getProvider(providerData.getName());
if (provider == null) {
listener.error("Failed to locate JMSMessagingProvider with name " + providerData.getName() + ". You must update the job configuration.");
return null;
}
JMSMessagingWorker worker = provider.createWorker(providerData, build.getParent().getName());
return worker.waitForMessage(build, listener, providerData);
}
use of com.redhat.jenkins.plugins.ci.messaging.JMSMessagingWorker in project jms-messaging-plugin by jenkinsci.
the class MessageUtils method sendMessage.
public static SendResult sendMessage(Run<?, ?> build, TaskListener listener, ProviderData pdata) {
String startMessage = "Sending message for job '" + build.getParent().getName() + "'.";
log.info(startMessage);
listener.getLogger().println(startMessage);
GlobalCIConfiguration config = GlobalCIConfiguration.get();
JMSMessagingWorker worker = config.getProvider(pdata.getName()).createWorker(pdata, build.getParent().getName());
SendResult sendResult = worker.sendMessage(build, listener, pdata);
String completedMessage = "Sent successfully with messageId: " + sendResult.getMessageId();
log.info(completedMessage);
listener.getLogger().println(completedMessage);
return sendResult;
}
Aggregations