Search in sources :

Example 1 with QueueConfiguration

use of org.mule.runtime.core.api.util.queue.QueueConfiguration in project mule by mulesoft.

the class QueueProfile method configureQueue.

public QueueConfiguration configureQueue(String component, QueueManager queueManager) throws InitialisationException {
    QueueConfiguration qc = new DefaultQueueConfiguration(maxOutstandingMessages, persistent);
    queueManager.setQueueConfiguration(component, qc);
    return qc;
}
Also used : DefaultQueueConfiguration(org.mule.runtime.core.api.util.queue.DefaultQueueConfiguration) DefaultQueueConfiguration(org.mule.runtime.core.api.util.queue.DefaultQueueConfiguration) QueueConfiguration(org.mule.runtime.core.api.util.queue.QueueConfiguration)

Example 2 with QueueConfiguration

use of org.mule.runtime.core.api.util.queue.QueueConfiguration in project mule by mulesoft.

the class AbstractQueueManager method setQueueConfiguration.

/**
 * {@inheritDoc}
 */
@Override
public synchronized void setQueueConfiguration(String queueName, QueueConfiguration newConfig) {
    // We allow calling this method only if the new config is equals to the previous one because of MULE-7420
    if (queues.containsKey(queueName) && !newConfig.equals(queueConfigurations.get(queueName))) {
        throw new MuleRuntimeException(CoreMessages.createStaticMessage(String.format("A queue with name %s is in use so we cannot change it's configuration", queueName)));
    }
    if (logger.isDebugEnabled()) {
        if (queueConfigurations.containsKey(queueName)) {
            QueueConfiguration oldConfiguration = queueConfigurations.get(queueName);
            logger.debug(String.format("Replacing queue %s configuration: %s with new newConfig: %s", queueName, oldConfiguration, newConfig));
        }
    }
    queueConfigurations.put(queueName, newConfig);
}
Also used : DefaultQueueConfiguration(org.mule.runtime.core.api.util.queue.DefaultQueueConfiguration) QueueConfiguration(org.mule.runtime.core.api.util.queue.QueueConfiguration) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException)

Aggregations

DefaultQueueConfiguration (org.mule.runtime.core.api.util.queue.DefaultQueueConfiguration)2 QueueConfiguration (org.mule.runtime.core.api.util.queue.QueueConfiguration)2 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)1