Example usage for org.springframework.jms.listener AbstractMessageListenerContainer setDestinationName

List of usage examples for org.springframework.jms.listener AbstractMessageListenerContainer setDestinationName

Introduction

In this page you can find the example usage for org.springframework.jms.listener AbstractMessageListenerContainer setDestinationName.

Prototype

public void setDestinationName(@Nullable String destinationName) 

Source Link

Document

Set the name of the destination to receive messages from.

Usage

From source file:org.bremersee.common.spring.autoconfigure.JmsListenerEndpointImpl.java

private void setupJmsListenerContainer(AbstractMessageListenerContainer listenerContainer) {
    if (getDestinationProperties() != null) {
        if (getDestinationProperties().getConcurrency() != null) {
            listenerContainer.setConcurrency(getDestinationProperties().getConcurrency());
        }/*from w w w.  j av  a 2s. co  m*/
        if (getDestinationProperties().getDestinationName() != null) {
            listenerContainer.setDestinationName(getDestinationProperties().getDestinationName());
        }
        listenerContainer.setPubSubDomain(getDestinationProperties().isPubSubDomain());
        listenerContainer.setPubSubNoLocal(getDestinationProperties().isPubSubNoLocal());
        listenerContainer.setSessionAcknowledgeMode(getDestinationProperties().getSessionAcknowledgeMode());
        listenerContainer.setSubscriptionDurable(destinationProperties.isSubscriptionDurable());
        if (getDestinationProperties().getSubscriptionName() != null) {
            listenerContainer.setSubscriptionName(getDestinationProperties().getSubscriptionName());
        }
        listenerContainer.setSubscriptionShared(getDestinationProperties().isSubscriptionShared());
    }
    if (getMessageSelector() != null) {
        listenerContainer.setMessageSelector(getMessageSelector());
    }
    setupMessageListener(listenerContainer);
}

From source file:org.apache.servicemix.jms.endpoints.JmsConsumerEndpoint.java

protected AbstractMessageListenerContainer createListenerContainer() {
    final AbstractMessageListenerContainer container;
    if (LISTENER_TYPE_DEFAULT.equals(listenerType)) {
        container = createDefaultMessageListenerContainer();
    } else if (LISTENER_TYPE_SIMPLE.equals(listenerType)) {
        container = createSimpleMessageListenerContainer();
    } else if (LISTENER_TYPE_SERVER.equals(listenerType)) {
        container = createServerSessionMessageListenerContainer();
    } else {//  w  ww. j  a  v  a2  s .  co  m
        throw new IllegalStateException();
    }
    container.setAutoStartup(false);
    container.setClientId(clientId);
    container.setConnectionFactory(getConnectionFactory());
    if (destination != null) {
        container.setDestination(destination);
    } else if (destinationName != null) {
        container.setDestinationName(destinationName);
    }
    if (getDestinationResolver() != null) {
        container.setDestinationResolver(getDestinationResolver());
    }
    if (subscriptionDurable) {
        if (durableSubscriptionName == null) {
            // Use unique name generated from this endpoint
            durableSubscriptionName = getService() + "#" + getEndpoint();
        }
        container.setDurableSubscriptionName(durableSubscriptionName);
    }
    container.setExceptionListener(exceptionListener);
    container.setMessageSelector(messageSelector);
    container.setPubSubDomain(isPubSubDomain());
    container.setSessionAcknowledgeMode(sessionAcknowledgeMode);
    container.setSubscriptionDurable(subscriptionDurable);
    return container;
}