|
|
@ -131,8 +131,8 @@ import org.springframework.util.ReflectionUtils; |
|
|
|
* @see SimpleMessageListenerContainer |
|
|
|
* @see SimpleMessageListenerContainer |
|
|
|
* @see org.springframework.jms.listener.endpoint.JmsMessageEndpointManager |
|
|
|
* @see org.springframework.jms.listener.endpoint.JmsMessageEndpointManager |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract class AbstractMessageListenerContainer |
|
|
|
public abstract class AbstractMessageListenerContainer extends AbstractJmsListeningContainer |
|
|
|
extends AbstractJmsListeningContainer implements MessageListenerContainer { |
|
|
|
implements MessageListenerContainer { |
|
|
|
|
|
|
|
|
|
|
|
private static final Method createSharedConsumerMethod = ClassUtils.getMethodIfAvailable( |
|
|
|
private static final Method createSharedConsumerMethod = ClassUtils.getMethodIfAvailable( |
|
|
|
Session.class, "createSharedConsumer", Topic.class, String.class, String.class); |
|
|
|
Session.class, "createSharedConsumer", Topic.class, String.class, String.class); |
|
|
@ -354,6 +354,7 @@ public abstract class AbstractMessageListenerContainer |
|
|
|
* <p>Only makes sense when listening to a topic (pub-sub domain), |
|
|
|
* <p>Only makes sense when listening to a topic (pub-sub domain), |
|
|
|
* therefore this method switches the "pubSubDomain" flag as well. |
|
|
|
* therefore this method switches the "pubSubDomain" flag as well. |
|
|
|
* <p><b>Requires a JMS 2.0 compatible message broker.</b> |
|
|
|
* <p><b>Requires a JMS 2.0 compatible message broker.</b> |
|
|
|
|
|
|
|
* @since 4.1 |
|
|
|
* @see #setSubscriptionName |
|
|
|
* @see #setSubscriptionName |
|
|
|
* @see #setSubscriptionDurable |
|
|
|
* @see #setSubscriptionDurable |
|
|
|
* @see #setPubSubDomain |
|
|
|
* @see #setPubSubDomain |
|
|
@ -367,6 +368,7 @@ public abstract class AbstractMessageListenerContainer |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Return whether to make the subscription shared. |
|
|
|
* Return whether to make the subscription shared. |
|
|
|
|
|
|
|
* @since 4.1 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isSubscriptionShared() { |
|
|
|
public boolean isSubscriptionShared() { |
|
|
|
return this.subscriptionShared; |
|
|
|
return this.subscriptionShared; |
|
|
@ -380,6 +382,7 @@ public abstract class AbstractMessageListenerContainer |
|
|
|
* <p>Note: Only 1 concurrent consumer (which is the default of this |
|
|
|
* <p>Note: Only 1 concurrent consumer (which is the default of this |
|
|
|
* message listener container) is allowed for each subscription, |
|
|
|
* message listener container) is allowed for each subscription, |
|
|
|
* except for a shared subscription (which requires JMS 2.0). |
|
|
|
* except for a shared subscription (which requires JMS 2.0). |
|
|
|
|
|
|
|
* @since 4.1 |
|
|
|
* @see #setPubSubDomain |
|
|
|
* @see #setPubSubDomain |
|
|
|
* @see #setSubscriptionDurable |
|
|
|
* @see #setSubscriptionDurable |
|
|
|
* @see #setSubscriptionShared |
|
|
|
* @see #setSubscriptionShared |
|
|
@ -390,6 +393,10 @@ public abstract class AbstractMessageListenerContainer |
|
|
|
this.subscriptionName = subscriptionName; |
|
|
|
this.subscriptionName = subscriptionName; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Return the name of a subscription to create, if any. |
|
|
|
|
|
|
|
* @since 4.1 |
|
|
|
|
|
|
|
*/ |
|
|
|
public String getSubscriptionName() { |
|
|
|
public String getSubscriptionName() { |
|
|
|
return this.subscriptionName; |
|
|
|
return this.subscriptionName; |
|
|
|
} |
|
|
|
} |
|
|
@ -423,6 +430,7 @@ public abstract class AbstractMessageListenerContainer |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set whether to inhibit the delivery of messages published by its own connection. |
|
|
|
* Set whether to inhibit the delivery of messages published by its own connection. |
|
|
|
* Default is "false". |
|
|
|
* Default is "false". |
|
|
|
|
|
|
|
* @since 4.1 |
|
|
|
* @see javax.jms.Session#createConsumer(javax.jms.Destination, String, boolean) |
|
|
|
* @see javax.jms.Session#createConsumer(javax.jms.Destination, String, boolean) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setPubSubNoLocal(boolean pubSubNoLocal) { |
|
|
|
public void setPubSubNoLocal(boolean pubSubNoLocal) { |
|
|
@ -431,6 +439,7 @@ public abstract class AbstractMessageListenerContainer |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Return whether to inhibit the delivery of messages published by its own connection. |
|
|
|
* Return whether to inhibit the delivery of messages published by its own connection. |
|
|
|
|
|
|
|
* @since 4.1 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isPubSubNoLocal() { |
|
|
|
public boolean isPubSubNoLocal() { |
|
|
|
return this.pubSubNoLocal; |
|
|
|
return this.pubSubNoLocal; |
|
|
@ -438,6 +447,7 @@ public abstract class AbstractMessageListenerContainer |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set the {@link MessageConverter} strategy for converting JMS Messages. |
|
|
|
* Set the {@link MessageConverter} strategy for converting JMS Messages. |
|
|
|
|
|
|
|
* @since 4.1 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setMessageConverter(MessageConverter messageConverter) { |
|
|
|
public void setMessageConverter(MessageConverter messageConverter) { |
|
|
|
this.messageConverter = messageConverter; |
|
|
|
this.messageConverter = messageConverter; |
|
|
@ -477,6 +487,7 @@ public abstract class AbstractMessageListenerContainer |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Return the ErrorHandler to be invoked in case of any uncaught exceptions thrown |
|
|
|
* Return the ErrorHandler to be invoked in case of any uncaught exceptions thrown |
|
|
|
* while processing a Message. |
|
|
|
* while processing a Message. |
|
|
|
|
|
|
|
* @since 4.1 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public ErrorHandler getErrorHandler() { |
|
|
|
public ErrorHandler getErrorHandler() { |
|
|
|
return this.errorHandler; |
|
|
|
return this.errorHandler; |
|
|
|