Search in sources :

Example 1 with JMSMessagingWorker

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);
}
Also used : JMSMessagingWorker(com.redhat.jenkins.plugins.ci.messaging.JMSMessagingWorker) JMSMessagingProvider(com.redhat.jenkins.plugins.ci.messaging.JMSMessagingProvider)

Example 2 with JMSMessagingWorker

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;
}
Also used : JMSMessagingWorker(com.redhat.jenkins.plugins.ci.messaging.JMSMessagingWorker) SendResult(com.redhat.jenkins.plugins.ci.messaging.data.SendResult) GlobalCIConfiguration(com.redhat.jenkins.plugins.ci.GlobalCIConfiguration)

Aggregations

JMSMessagingWorker (com.redhat.jenkins.plugins.ci.messaging.JMSMessagingWorker)2 GlobalCIConfiguration (com.redhat.jenkins.plugins.ci.GlobalCIConfiguration)1 JMSMessagingProvider (com.redhat.jenkins.plugins.ci.messaging.JMSMessagingProvider)1 SendResult (com.redhat.jenkins.plugins.ci.messaging.data.SendResult)1