Class JmsActivationSpecConfig
java.lang.Object
org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
- Direct Known Subclasses:
DefaultJcaListenerContainerFactory
Common configuration object for activating a JMS message endpoint.
Gets converted into a provider-specific JCA 1.5 ActivationSpec
object for activating the endpoint.
Typically used in combination with JmsMessageEndpointManager,
but not tied to it.
- Since:
- 2.5
- Author:
- Juergen Hoeller, Stephane Nicoll, Sam Brannen
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturn the JMS acknowledgement mode to use.intReturn the maximum number of consumers/sessions to use.Return theMessageConverterto use, if any.intReturn the maximum number of messages to load into a session.booleanbooleanbooleanbooleanvoidsetAcknowledgeMode(int acknowledgeMode) Set the JMS acknowledgement mode to use.voidsetAcknowledgeModeName(String constantName) Set the JMS acknowledgement mode by the name of the corresponding constant in the JMSSessioninterface — for example,"CLIENT_ACKNOWLEDGE".voidsetClientId(@Nullable String clientId) voidsetConcurrency(String concurrency) Specify concurrency limits via a "lower-upper" String, for example, "5-10", or a simple upper limit String, for example, "10".voidsetDestinationName(@Nullable String destinationName) voidsetDurableSubscriptionName(@Nullable String durableSubscriptionName) voidsetMaxConcurrency(int maxConcurrency) Specify the maximum number of consumers/sessions to use, effectively controlling the number of concurrent invocations on the target listener.voidsetMessageConverter(@Nullable MessageConverter messageConverter) Set theMessageConverterstrategy for converting JMS Messages.voidsetMessageSelector(@Nullable String messageSelector) voidsetPrefetchSize(int prefetchSize) Specify the maximum number of messages to load into a session (a kind of batch size).voidsetPubSubDomain(boolean pubSubDomain) voidsetReplyPubSubDomain(boolean replyPubSubDomain) voidsetReplyQosSettings(@Nullable QosSettings replyQosSettings) voidsetSubscriptionDurable(boolean subscriptionDurable) voidsetSubscriptionName(@Nullable String subscriptionName) voidsetSubscriptionShared(boolean subscriptionShared)
-
Constructor Details
-
JmsActivationSpecConfig
public JmsActivationSpecConfig()
-
-
Method Details
-
setDestinationName
-
getDestinationName
-
setPubSubDomain
public void setPubSubDomain(boolean pubSubDomain) -
isPubSubDomain
public boolean isPubSubDomain() -
setReplyPubSubDomain
public void setReplyPubSubDomain(boolean replyPubSubDomain) -
isReplyPubSubDomain
public boolean isReplyPubSubDomain() -
setReplyQosSettings
-
getReplyQosSettings
-
setSubscriptionDurable
public void setSubscriptionDurable(boolean subscriptionDurable) -
isSubscriptionDurable
public boolean isSubscriptionDurable() -
setSubscriptionName
-
getSubscriptionName
-
setDurableSubscriptionName
-
getDurableSubscriptionName
-
setClientId
-
getClientId
-
setMessageSelector
-
getMessageSelector
-
setAcknowledgeModeName
Set the JMS acknowledgement mode by the name of the corresponding constant in the JMSSessioninterface — for example,"CLIENT_ACKNOWLEDGE".Note that JCA resource adapters generally only support auto and dups-ok (see Spring's
StandardJmsActivationSpecFactory). ActiveMQ also supports "SESSION_TRANSACTED" in the form of RA-managed transactions (automatically translated by Spring'sDefaultJmsActivationSpecFactory).- Parameters:
constantName- the name of theSessionacknowledge mode constant- See Also:
-
setAcknowledgeMode
public void setAcknowledgeMode(int acknowledgeMode) Set the JMS acknowledgement mode to use.- See Also:
-
getAcknowledgeMode
public int getAcknowledgeMode()Return the JMS acknowledgement mode to use. -
setConcurrency
Specify concurrency limits via a "lower-upper" String, for example, "5-10", or a simple upper limit String, for example, "10".JCA listener containers will always scale from zero to the given upper limit. A specified lower limit will effectively be ignored.
This property is primarily supported for configuration compatibility with
DefaultMessageListenerContainer. For this activation config, generally usesetMaxConcurrency(int)instead. -
setMaxConcurrency
public void setMaxConcurrency(int maxConcurrency) Specify the maximum number of consumers/sessions to use, effectively controlling the number of concurrent invocations on the target listener. -
getMaxConcurrency
public int getMaxConcurrency()Return the maximum number of consumers/sessions to use. -
setPrefetchSize
public void setPrefetchSize(int prefetchSize) Specify the maximum number of messages to load into a session (a kind of batch size). -
getPrefetchSize
public int getPrefetchSize()Return the maximum number of messages to load into a session. -
setMessageConverter
Set theMessageConverterstrategy for converting JMS Messages.- Parameters:
messageConverter- the message converter to use
-
getMessageConverter
Return theMessageConverterto use, if any.
-