类 BatchMessageListenerContainer

  • 所有已实现的接口:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, org.springframework.jms.listener.MessageListenerContainer

    public class BatchMessageListenerContainer
    extends org.springframework.jms.listener.DefaultMessageListenerContainer
    Message listener container adapted for intercepting the message reception with advice provided through configuration.
    To enable batching of messages in a single transaction, use the TransactionInterceptor and the RepeatOperationsInterceptor in the advice chain (with or without a transaction manager set in the base class). Instead of receiving a single message and processing it, the container will then use a RepeatOperations to receive multiple messages in the same thread. Use with a RepeatOperations and a transaction interceptor. If the transaction interceptor uses XA then use an XA connection factory, or else the TransactionAwareConnectionFactoryProxy to synchronize the JMS session with the ongoing transaction (opening up the possibility of duplicate messages after a failure). In the latter case you will not need to provide a transaction manager in the base class - it only gets on the way and prevents the JMS session from synchronizing with the database transaction.
    作者:
    Dave Syer
    • 嵌套类概要

      嵌套类 
      修饰符和类型说明
      static interface BatchMessageListenerContainer.ContainerDelegate 
      • 从类继承的嵌套类/接口 org.springframework.jms.listener.AbstractJmsListeningContainer

        org.springframework.jms.listener.AbstractJmsListeningContainer.SharedConnectionNotInitializedException
    • 字段概要

      • 从类继承的字段 org.springframework.jms.listener.DefaultMessageListenerContainer

        CACHE_AUTO, CACHE_CONNECTION, CACHE_CONSUMER, CACHE_NONE, CACHE_SESSION, DEFAULT_RECOVERY_INTERVAL, DEFAULT_THREAD_NAME_PREFIX
      • 从类继承的字段 org.springframework.jms.listener.AbstractPollingMessageListenerContainer

        DEFAULT_RECEIVE_TIMEOUT
      • 从类继承的字段 org.springframework.jms.listener.AbstractJmsListeningContainer

        lifecycleMonitor, sharedConnectionMonitor
      • 从类继承的字段 org.springframework.jms.support.destination.JmsDestinationAccessor

        RECEIVE_TIMEOUT_INDEFINITE_WAIT, RECEIVE_TIMEOUT_NO_WAIT
      • 从类继承的字段 org.springframework.jms.support.JmsAccessor

        logger
      • 从接口继承的字段 org.springframework.context.SmartLifecycle

        DEFAULT_PHASE
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      voidafterPropertiesSet()
      Set up interceptor with provided advice on the receiveAndExecute(Object, Session, MessageConsumer) method.
      protected voidhandleListenerException​(java.lang.Throwable ex)
      Override base class to prevent exceptions from being swallowed.
      voidinitializeProxy() 
      protected booleanreceiveAndExecute​(java.lang.Object invoker, javax.jms.Session session, javax.jms.MessageConsumer consumer)
      Override base class method to wrap call in advice if provided.
      voidsetAdviceChain​(org.aopalliance.aop.Advice[] advices)
      Public setter for the Advice.
      • 从类继承的方法 org.springframework.jms.listener.DefaultMessageListenerContainer

        applyBackOffTime, createDefaultTaskExecutor, doInitialize, doRescheduleTask, doShutdown, establishSharedConnection, getActiveConsumerCount, getCacheLevel, getConcurrentConsumers, getIdleConsumerLimit, getIdleTaskExecutionLimit, getMaxConcurrentConsumers, getMaxMessagesPerTask, getScheduledConsumerCount, handleListenerSetupFailure, initialize, isRecovering, isRegisteredWithDestination, messageReceived, noMessageReceived, recoverAfterListenerSetupFailure, refreshConnectionUntilSuccessful, refreshDestination, scheduleNewInvokerIfAppropriate, setBackOff, setCacheLevel, setCacheLevelName, setConcurrency, setConcurrentConsumers, setIdleConsumerLimit, setIdleTaskExecutionLimit, setMaxConcurrentConsumers, setMaxMessagesPerTask, setRecoveryInterval, setTaskExecutor, sharedConnectionEnabled, start, startSharedConnection, stop, stopSharedConnection
      • 从类继承的方法 org.springframework.jms.listener.AbstractPollingMessageListenerContainer

        createListenerConsumer, doReceiveAndExecute, getConnection, getReceiveTimeout, getSession, getTransactionManager, isSessionLocallyTransacted, receiveMessage, setReceiveTimeout, setSessionTransacted, setTransactionManager, setTransactionName, setTransactionTimeout, shouldCommitAfterNoMessageReceived
      • 从类继承的方法 org.springframework.jms.listener.AbstractMessageListenerContainer

        checkMessageListener, commitIfNecessary, createConsumer, doExecuteListener, doInvokeListener, doInvokeListener, executeListener, getDefaultSubscriptionName, getDestination, getDestinationDescription, getDestinationName, getDurableSubscriptionName, getErrorHandler, getExceptionListener, getMessageConverter, getMessageListener, getMessageSelector, getReplyQosSettings, getSubscriptionName, invokeErrorHandler, invokeExceptionListener, invokeListener, isAcceptMessagesWhileStopping, isExposeListenerSession, isPubSubNoLocal, isReplyPubSubDomain, isSubscriptionDurable, isSubscriptionShared, rollbackIfNecessary, rollbackOnExceptionIfNecessary, setAcceptMessagesWhileStopping, setDestination, setDestinationName, setDurableSubscriptionName, setErrorHandler, setExceptionListener, setExposeListenerSession, setMessageConverter, setMessageListener, setMessageSelector, setPubSubNoLocal, setReplyPubSubDomain, setReplyQosSettings, setSubscriptionDurable, setSubscriptionName, setSubscriptionShared, setupMessageListener, validateConfiguration
      • 从类继承的方法 org.springframework.jms.listener.AbstractJmsListeningContainer

        createSharedConnection, destroy, doStart, doStop, getBeanName, getClientId, getPausedTaskCount, getPhase, getSharedConnection, isActive, isAutoStartup, isRunning, logRejectedTask, prepareSharedConnection, refreshSharedConnection, rescheduleTaskIfNecessary, resumePausedTasks, runningAllowed, setAutoStartup, setBeanName, setClientId, setPhase, shutdown, stop
      • 从类继承的方法 org.springframework.jms.support.destination.JmsDestinationAccessor

        getDestinationResolver, isPubSubDomain, receiveFromConsumer, resolveDestinationName, setDestinationResolver, setPubSubDomain
      • 从类继承的方法 org.springframework.jms.support.JmsAccessor

        convertJmsAccessException, createConnection, createSession, getConnectionFactory, getSessionAcknowledgeMode, isClientAcknowledge, isSessionTransacted, obtainConnectionFactory, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • 从接口继承的方法 org.springframework.context.Lifecycle

        isRunning, stop
      • 从接口继承的方法 org.springframework.jms.listener.MessageListenerContainer

        getDestinationResolver, isPubSubDomain
      • 从接口继承的方法 org.springframework.context.SmartLifecycle

        getPhase, isAutoStartup
    • 方法详细资料

      • setAdviceChain

        public void setAdviceChain​(org.aopalliance.aop.Advice[] advices)
        Public setter for the Advice.
        参数:
        advices - the advice to set
      • afterPropertiesSet

        public void afterPropertiesSet()
        Set up interceptor with provided advice on the receiveAndExecute(Object, Session, MessageConsumer) method.
        指定者:
        afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBean
        覆盖:
        afterPropertiesSet 在类中 org.springframework.jms.listener.AbstractJmsListeningContainer
        另请参阅:
        AbstractJmsListeningContainer.afterPropertiesSet()
      • handleListenerException

        protected void handleListenerException​(java.lang.Throwable ex)
        Override base class to prevent exceptions from being swallowed. Should be an injectable strategy (see SPR-4733).
        覆盖:
        handleListenerException 在类中 org.springframework.jms.listener.AbstractMessageListenerContainer
        另请参阅:
        AbstractMessageListenerContainer.handleListenerException(java.lang.Throwable)
      • receiveAndExecute

        protected boolean receiveAndExecute​(java.lang.Object invoker,
                                            javax.jms.Session session,
                                            javax.jms.MessageConsumer consumer)
                                     throws javax.jms.JMSException
        Override base class method to wrap call in advice if provided.
        覆盖:
        receiveAndExecute 在类中 org.springframework.jms.listener.AbstractPollingMessageListenerContainer
        抛出:
        javax.jms.JMSException
        另请参阅:
        AbstractPollingMessageListenerContainer.receiveAndExecute(Object, javax.jms.Session, javax.jms.MessageConsumer)