All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.yandex.qatools.camelot.activemq.ActivemqPluginUriBuilder Maven / Gradle / Ivy

There is a newer version: 2.5.4
Show newest version
package ru.yandex.qatools.camelot.activemq;

import ru.yandex.qatools.camelot.common.PluginUriBuilder;
import ru.yandex.qatools.camelot.common.builders.BasicPluginUriBuilder;
import ru.yandex.qatools.camelot.config.Plugin;

import static org.apache.commons.lang3.StringUtils.isEmpty;

/**
 * @author Ilya Sadykov
 */
public class ActivemqPluginUriBuilder extends BasicPluginUriBuilder implements PluginUriBuilder {
    public static final String PLUGIN_IN_PREFIX = "activemq:queue:plugin";
    public static final String CLIENT_NOTIFY_URI = "activemq:topic:frontend.notify";
    public static final String TMP_INPUT_BUFFER_URI = "activemq:queue:tmp.input.buffer";
    public static final String BROADCAST_CONFIG = "?receiveTimeout=15000&requestTimeout=10000" +
            "&destination.consumer.maximumPendingMessageLimit=1&destination.consumer.prefetchSize=1" +
            "&destination.consumer.dispatchAsync=true";

    @Override
    public String broadcastUri(String pluginId, String suffix) {
        return "activemq:topic:" + pluginId + ((isEmpty(suffix)) ? "" : "." + suffix) + BROADCAST_CONFIG;
    }

    @Override
    public String pluginUri(Plugin plugin, String suffix, String brokerConfig) {
        return plugin.getBaseInputUri() + "." + plugin.getId()
                + (isEmpty(suffix) ? "" : "." + suffix)
                + (isEmpty(brokerConfig) ? "" : brokerConfig);
    }

    @Override
    public String tmpInputBufferUri() {
        return TMP_INPUT_BUFFER_URI;
    }

    @Override
    public String frontendBroadcastUri() {
        return CLIENT_NOTIFY_URI + BROADCAST_CONFIG;
    }

    @Override
    public String basePluginUri() {
        return PLUGIN_IN_PREFIX;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy