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 BROADCAST_CONFIG = "?receiveTimeout=15000&requestTimeout=10000" +
            "&destination.consumer.maximumPendingMessageLimit=1&destination.consumer.prefetchSize=1" +
            "&destination.consumer.dispatchAsync=true";

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy