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

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

Introduction

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

Prototype

public void setPubSubDomain(boolean pubSubDomain) 

Source Link

Document

Configure the destination accessor with knowledge of the JMS domain used.

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  ww . j  a  v a  2s  .  c o  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 {/*from   w  w  w .  j a  va 2  s . c o  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;
}