日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

深入理解DefaultMessageListenerContainer

發布時間:2024/4/17 编程问答 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 深入理解DefaultMessageListenerContainer 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

http://blog.csdn.net/zhaozhenzuo/article/details/7934881

?

DefaultMessageListenerContainer是一個用于異步消息監聽的管理類。

? DefaultMessageListenerContainer最簡單的實現邏輯,一個任務執行器,執行任務(即消息監聽)。

? DefaultMessageListenerContainer實現的主要原理是,通過內部初始化建立的一個taskExecutor(默認是SimpleAsyncTaskExecutor)用于執行消息監聽的任務(AsyncMessageListenerInvoker)。

?這里默認的任務執行器是SimpleAsyncTaskExecutor,這個執行器的缺點是不會重用連接,也就是對于每個任務都需要新開啟一個線程,執行完任務后會關閉它。如果要優化的話可以考慮線程池。

?消息監聽的任務被抽象成AsyncMessageListenerInvoker類,這個類實現了Runnable接口,內部run方法其實是通過不斷循環consumer.recieve()方法來實現監聽。

?

?事實上一個消費者對應了一個AsyncMessageListenerInvoker任務,每個任務需要一個單獨的線程去執行它。這個AsyncMessageListenerInvoker實例被放在了一個名為scheduledInvokers的set里面。

?其實我們還有一個比較關心的地方是這個DefaultMessageListenerContainer緩不緩存connection,session,consumer。它是根據catchLevel屬性來決定是否緩存connection,session,consumer。默認的catchLevel對應常量CATCH_AUTO,即由配置的外部事務管理器決定。catchLevel級別分別是CATCH_NONE,CATCH_CONNECTION,CATCH_SESSION,CATCH_CONSUMER,分別對應0,1,2,3。我試了下默認的CATCH_AUTO在沒有定義事務管理時值為 CATCH_CONSUMER,即3。

?DefaultMessageListenerContainer會根據catchLevel來緩存共享connection,session,及consumer。值為3的話就會緩存connection,session,及consumer,在初始化的時候就會調用父類AbstractJmsListeningContainer的doStart()方法,判斷cacheLevel是否大于等于1,如果大于就創建一個connection將放入成員變量sharedConnection中。

? 每個任務被執行的時候(即責任是監聽消息),會先去獲取connection,session及consumer(通過調用initResourcesIfNecessary方法)就像我們自己最初實現一個簡單的客戶端消費者一樣。只不過這里會根據catchLevel來決定是否緩存session及consumer。被緩存了的session及consumer放在對應的成員變量里面。

?接著任務會想要執行consumer.recieve方法,這之前肯定要獲取onnection,session及consumer,如果已有onnection,session及consumer則獲取過來,如果沒有則通過配置的信息新建。執行完consumer.recieve后,會判斷consumer.recieve返回的消息是否為空。

? 不為空則調用message對應的messageListner(之前我們在DefaultMessageListenerContainer中通過方法setMessageListner設置的)的onMessage執行相應的邏輯,并設置這個任務的Idle為false,表明這個任務不是空閑的,然后會調用方法判斷是否應該新建任務實例,這個受限于MaxConcurrentConsumers及IdleTaskExecutionLimit。為空則不需要特別處理,只需調用noMessageReceived方法將idle標記設為true。

? 任務執行完后,會在finally處釋放connection,session及consumer。這個是根據上述講的catchLevel來設置的。


? 繼承體系如下:

???


AbstractJmsListeningContainer提供了一個最上層最基礎的jms消息監聽管理類所應該有的方法。提供了start(啟動這個管理類),stop,initialize(初始化這個管理類),establishSharedConnection等。

?

====================

http://blog.sina.com.cn/s/blog_6592ed330100loqk.html

DefaultMessageListenerContainer繼承自AbstractPollingMessageListenerContainer,主要使用同步的方式接收消息(也就是通過循環調用MessageConsumer.receive的方式接收消息)。該類主要的屬性如下:

Java代碼
  • private?int?concurrentConsumers?=?1; ??
  • private?int?maxConcurrentConsumers?=?1; ??
  • private?int?maxMessagesPerTask?=?Integer.MIN_VALUE; ??
  • private?int?idleTaskExecutionLimit?=?1; ??
  • private?final?Set?scheduledInvokers?=?new?HashSet(); ??
  • private?TaskExecutor?taskExecutor; ??
  • private?int?cacheLevel?=?CACHE_AUTO
  • ?

    ??? 跟SimpleMessageListenerContainer一樣,DefaultMessageListenerContainer也支持創建多個Session和MessageConsumer來接收消息。跟SimpleMessageListenerContainer不同的是,DefaultMessageListenerContainer創建了concurrentConsumers所指定個數的AsyncMessageListenerInvoker(實現了SchedulingAwareRunnable接口),并交給taskExecutor運行。


    ??? maxMessagesPerTask屬性的默認值是Integer.MIN_VALUE,但是如果設置的taskExecutor(默認值是SimpleAsyncTaskExecutor)實現了SchedulingTaskExecutor接口并且其prefersShortLivedTasks方法返回true(也就是說該TaskExecutor傾向于短期任務),那么maxMessagesPerTask屬性會自動被設置為10。
    ??? 如果maxMessagesPerTask屬性的值小于0,那么AsyncMessageListenerInvoker.run方法會在循環中反復嘗試接收消息,并在接收到消息后調用MessageListener(或者SessionAwareMessageListener);如果maxMessagesPerTask屬性的值不小于0,那么AsyncMessageListenerInvoker.run方法里最多會嘗試接收消息maxMessagesPerTask次,每次接收消息的超時時間由其父類AbstractPollingMessageListenerContainer的receiveTimeout屬性指定。如果在這些嘗試中都沒有接收到消息,那么AsyncMessageListenerInvoker的idleTaskExecutionCount屬性會被累加。在run方法執行完畢前會對idleTaskExecutionCount進行檢查,如果該值超過了DefaultMessageListenerContainer.idleTaskExecutionLimit(默認值1),那么這個AsyncMessageListenerInvoker可能會被銷毀。


    ??? 所有AsyncMessageListenerInvoker實例都保存在scheduledInvokers中,實例的個數可以在concurrentConsumers和maxConcurrentConsumers之間浮動。跟SimpleMessageListenerContainer一樣,應該只是在Destination為Queue的時候才使用多個AsyncMessageListenerInvoker實例。

    ?

    ??? cacheLevel屬性用于指定是否對JMS資源進行緩存,可選的值是CACHE_NONE = 0、CACHE_CONNECTION = 1、CACHE_SESSION = 2、CACHE_CONSUMER = 3和CACHE_AUTO = 4。默認情況下,如果transactionManager屬性不為null,那么cacheLevel被自動設置為CACHE_NONE(不進行緩存),否則cacheLevel被自動設置為CACHE_CONSUMER。


    ??? 如果cacheLevel屬性值大于等于CACHE_CONNECTION,那么sharedConnectionEnabled方法(在AbstractJmsListeningContainer中定義)返回true,也就是說使用共享的JMS連接。

    ?

    ======================

    http://camel.apache.org/jms.html

    JMS Component

    ?

    Most commonly used options

    OptionDefault ValueDescription
    clientIdnullSets the JMS client ID to use. Note that this value, if specified, must be unique and can only be used by a single JMS connection instance. It is typically only required for durable topic subscriptions. You may prefer to useVirtual Topics instead.
    concurrentConsumers1Specifies the default number of concurrent consumers. FromCamel 2.10.3 onwards this option can also be used when doing request/reply over JMS. See also themaxMessagesPerTask option to control dynamic scaling up/down of threads.
    disableReplyTofalseIf true, a producer will behave like a InOnly exchange with the exception thatJMSReplyTo header is sent out and not be suppressed like in the case of InOnly. Like InOnly the producer will not wait for a reply. A consumer with this flag will behave likeInOnly. This feature can be used to bridge InOut requests to another queue so that a route on the other queue will send it′s response directly back to the originalJMSReplyTo.
    durableSubscriptionNamenullThe durable subscriber name for specifying durable topic subscriptions. TheclientId option must be configured as well.
    maxConcurrentConsumers1Specifies the maximum number of concurrent consumers. FromCamel 2.10.3 onwards this option can also be used when doing request/reply over JMS. See also themaxMessagesPerTask option to control dynamic scaling up/down of threads.
    maxMessagesPerTask-1The number of messages per task. -1 is unlimited. If you use a range for concurrent consumers (eg min < max), then this option can be used to set a value to eg100 to control how fast the consumers will shrink when less work is required.
    preserveMessageQosfalseSet to true, if you want to send message using the QoS settings specified on the message, instead of the QoS settings on the JMS endpoint. The following three headers are consideredJMSPriority, JMSDeliveryMode, and JMSExpiration. You can provide all or only some of them. If not provided, Camel will fall back to use the values from the endpoint instead. So, when using this option, the headers override the values from the endpoint. The explicitQosEnabled option, by contrast, will only use options set on the endpoint, and not values from the message header.
    replyTonullProvides an explicit ReplyTo destination, which overrides any incoming value ofMessage.getJMSReplyTo(). If you do Request Reply over JMS then make sure to read the section Request-reply over JMS further below for more details, and the replyToType option as well.
    replyToTypenullCamel 2.9: Allows for explicitly specifying which kind of strategy to use for replyTo queues when doing request/reply over JMS. Possible values are:Temporary, Shared, or Exclusive. By default Camel will use temporary queues. However ifreplyTo has been configured, then Shared is used by default. This option allows you to use exclusive queues instead of shared ones. See further below for more details, and especially the notes about the implications if running in a clustered environment, and the fact that Shared reply queues has lower performance than its alternativesTemporary and Exclusive.
    requestTimeout20000Producer only: The timeout for waiting for a reply when using the InOutExchange Pattern (in milliseconds). The default is 20 seconds. See below in sectionAbout time to live for more details. See also the requestTimeoutCheckerInterval option.
    selectornullSets the JMS Selector, which is an SQL 92 predicate that is used to filter messages within the broker. You may have to encode special characters such as = as %3DBefore Camel 2.3.0, we don't support this option in CamelConsumerTemplate
    timeToLivenullWhen sending messages, specifies the time-to-live of the message (in milliseconds). See below in sectionAbout time to live for more details.
    transactedfalseSpecifies whether to use transacted mode for sending/receiving messages using the InOnlyExchange Pattern.
    testConnectionOnStartupfalseCamel 2.1: Specifies whether to test the connection on startup. This ensures that when Camel starts that all the JMS consumers have a valid connection to the JMS broker. If a connection cannot be granted then Camel throws an exception on startup. This ensures that Camel is not started with failed connections. FromCamel 2.8 onwards also the JMS producers is tested as well.

    All the other options

    OptionDefault ValueDescription
    acceptMessagesWhileStoppingfalseSpecifies whether the consumer accept messages while it is stopping. You may consider enabling this option, if you start and stopJMS routes at runtime, while there are still messages enqued on the queue. If this option isfalse, and you stop the JMS route, then messages may be rejected, and the JMS broker would have to attempt redeliveries, which yet again may be rejected, and eventually the message may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option.
    acknowledgementModeNameAUTO_ACKNOWLEDGEThe JMS acknowledgement name, which is one of: SESSION_TRANSACTED,CLIENT_ACKNOWLEDGE, AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE
    acknowledgementMode-1The JMS acknowledgement mode defined as an Integer. Allows you to set vendor-specific extensions to the acknowledgment mode. For the regular modes, it is preferable to use theacknowledgementModeName instead.
    allowNullBodytrueCamel 2.9.3/2.10.1: Whether to allow sending messages with no body. If this option isfalse and the message body is null, then an JMSException is thrown.
    alwaysCopyMessagefalseIf true, Camel will always make a JMS message copy of the message when it is passed to the producer for sending. Copying the message is needed in some situations, such as when areplyToDestinationSelectorName is set (incidentally, Camel will set the alwaysCopyMessage option to true, if a replyToDestinationSelectorName is set)
    asyncConsumerfalseCamel 2.9: Whether the JmsConsumer processes theExchange asynchronously. If enabled then the JmsConsumer may pickup the next message from the JMS queue, while the previous message is being processed asynchronously (by theAsynchronous Routing Engine). This means that messages may be processed not 100% strictly in order. If disabled (as default) then theExchange is fully processed before the JmsConsumer will pickup the next message from the JMS queue. Note iftransacted has been enabled, then asyncConsumer=true does not run asynchronously, as transactions must be executed synchronously (Camel 3.0 may support async transactions).
    asyncStartListenerfalseCamel 2.10: Whether to startup the JmsConsumer message listener asynchronously, when starting a route. For example if aJmsConsumer cannot get a connection to a remote JMS broker, then it may block while retrying and/or failover. This will cause Camel to block while starting routes. By setting this option totrue, you will let routes startup, while the JmsConsumer connects to the JMS broker using a dedicated thread in asynchronous mode. If this option is used, then beware that if the connection could not be established, then an exception is logged at WARN level, and the consumer will not be able to receive messages; You can then restart the route to retry.
    asyncStopListenerfalseCamel 2.10: Whether to stop the JmsConsumer message listener asynchronously, when stopping a route.
    autoStartuptrueSpecifies whether the consumer container should auto-startup.
    cacheLevelNameCACHE_AUTO (Camel >= 2.8.0)
    CACHE_CONSUMER (Camel <= 2.7.1)
    Sets the cache level by name for the underlying JMS resources. Possible values are:CACHE_AUTO, CACHE_CONNECTION, CACHE_CONSUMER, CACHE_NONE, andCACHE_SESSION. The default setting for Camel 2.8 and newer isCACHE_AUTO. For Camel 2.7.1 and older the default is CACHE_CONSUMER. See the Spring documentation and Transactions Cache Levels for more information.
    cacheLevel?Sets the cache level by ID for the underlying JMS resources. SeecacheLevelName option for more details.
    consumerTypeDefaultThe consumer type to use, which can be one of: Simple,Default, or Custom. The consumer type determines which Spring JMS listener to use.Default will use org.springframework.jms.listener.DefaultMessageListenerContainer,Simple will use org.springframework.jms.listener.SimpleMessageListenerContainer. WhenCustom is specified, the MessageListenerContainerFactory defined by themessageListenerContainerFactoryRef option will determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use (new option in Camel 2.10.2 onwards). This option was temporary removed in Camel 2.7 and 2.8. But has been added back from Camel 2.9 onwards.
    connectionFactorynullThe default JMS connection factory to use for the listenerConnectionFactory andtemplateConnectionFactory, if neither is specified.
    defaultTaskExecutorType(see description)Camel 2.10.4: Specifies what default TaskExecutor type to use in the DefaultMessageListenerContainer, for both consumer endpoints and the ReplyTo consumer of producer endpoints. Possible values:SimpleAsync (uses Spring's SimpleAsyncTaskExecutor) or ThreadPool (uses Spring's ThreadPoolTaskExecutor with optimal values - cached threadpool-like). If not set, it defaults to the previous behaviour, which uses a cached thread pool for consumer endpoints and SimpleAsync for reply consumers. The use ofThreadPool is recommended to reduce "thread trash" in elastic configurations with dynamically increasing and decreasing concurrent consumers.
    deliveryPersistenttrueSpecifies whether persistent delivery is used by default.
    destinationnullSpecifies the JMS Destination object to use on this endpoint.
    destinationNamenullSpecifies the JMS destination name to use on this endpoint.
    destinationResolvernullA pluggable org.springframework.jms.support.destination.DestinationResolver that allows you to use your own resolver (for example, to lookup the real destination in a JNDI registry).
    disableTimeToLivefalseCamel 2.8: Use this option to force disabling time to live. For example when you do request/reply over JMS, then Camel will by default use therequestTimeout value as time to live on the message being sent. The problem is that the sender and receiver systems have to have their clocks synchronized, so they are in sync. This is not always so easy to archive. So you can usedisableTimeToLive=true to not set a time to live value on the sent message. Then the message will not expire on the receiver system. See below in sectionAbout time to live for more details.
    eagerLoadingOfPropertiesfalseEnables eager loading of JMS properties as soon as a message is received, which is generally inefficient, because the JMS properties might not be required. But this feature can sometimes catch early any issues with the underlying JMS provider and the use of JMS properties. This feature can also be used for testing purposes, to ensure JMS properties can be understood and handled correctly.
    exceptionListenernullSpecifies the JMS Exception Listener that is to be notified of any underlying JMS exceptions.
    errorHandlernullCamel 2.8.2, 2.9: Specifies a org.springframework.util.ErrorHandler to be invoked in case of any uncaught exceptions thrown while processing aMessage. By default these exceptions will be logged at the WARN level, if noerrorHandler has been configured. From Camel 2.9.1: onwards you can configure logging level and whether stack traces should be logged using the below two options. This makes it much easier to configure, than having to code a customerrorHandler.
    errorHandlerLoggingLevelWARNCamel 2.9.1: Allows to configure the defaulterrorHandler logging level for logging uncaught exceptions.
    errorHandlerLogStackTracetrueCamel 2.9.1: Allows to control whether stacktraces should be logged or not, by the defaulterrorHandler.
    explicitQosEnabledfalseSet if the deliveryMode, priority or timeToLive qualities of service should be used when sending messages. This option is based on Spring'sJmsTemplate. The deliveryMode, priority and timeToLive options are applied to the current endpoint. This contrasts with thepreserveMessageQos option, which operates at message granularity, reading QoS properties exclusively from the Camel In message headers.
    exposeListenerSessiontrueSpecifies whether the listener session should be exposed when consuming messages.
    forceSendOriginalMessagefalseCamel 2.7: When using mapJmsMessage=false Camel will create a new JMS message to send to a new JMS destination if you touch the headers (get or set) during the route. Set this option totrue to force Camel to send the original JMS message that was received.
    idleTaskExecutionLimit1Specifies the limit for idle executions of a receive task, not having received any message within its execution. If this limit is reached, the task will shut down and leave receiving to other executing tasks (in the case of dynamic scheduling; see the maxConcurrentConsumers setting). There is additional doc available fromSpring.
    idleConsumerLimit1Camel 2.8.2, 2.9: Specify the limit for the number of consumers that are allowed to be idle at any given time.
    includeSentJMSMessageIDfalseCamel 2.10.3: Only applicable when sending to JMS destination using InOnly (eg fire and forget). Enabling this option will enrich the CamelExchange with the actual JMSMessageID that was used by the JMS client when the message was sent to the JMS destination.
    includeAllJMSXPropertiesfalseCamel 2.11.2/2.12: Whether to include all JMSXxxx properties when mapping from JMS to Camel Message. Setting this totrue will include properties such as JMSXAppID, and JMSXUserID etc.Note: If you are using a custom headerFilterStrategy then this option does not apply.
    jmsMessageTypenullAllows you to force the use of a specific javax.jms.Message implementation for sending JMS messages. Possible values are:Bytes, Map, Object, Stream, Text. By default, Camel would determine which JMS message type to use from the In body type. This option allows you to specify it.
    jmsKeyFormatStrategydefaultPluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box:default and passthrough. The default strategy will safely marshal dots and hyphens (. and-). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of theorg.apache.camel.component.jms.JmsKeyFormatStrategy and refer to it using the# notation.
    jmsOperationsnullAllows you to use your own implementation of the org.springframework.jms.core.JmsOperations interface. Camel usesJmsTemplate as default. Can be used for testing purpose, but not used much as stated in the spring API docs.
    lazyCreateTransactionManagertrueIf true, Camel will create a JmsTransactionManager, if there is notransactionManager injected when option transacted=true.
    listenerConnectionFactorynullThe JMS connection factory used for consuming messages.
    mapJmsMessagetrueSpecifies whether Camel should auto map the received JMS message to an appropiate payload type, such asjavax.jms.TextMessage to a String etc. See section about how mapping works below for more details.
    maximumBrowseSize-1Limits the number of messages fetched at most, when browsing endpoints usingBrowse or JMX API.
    messageConverternullTo use a custom Spring org.springframework.jms.support.converter.MessageConverter so you can be 100% in control how to map to/from ajavax.jms.Message.
    messageIdEnabledtrueWhen sending, specifies whether message IDs should be added.
    messageListenerContainerFactoryRefnullCamel 2.10.2: Registry ID of the MessageListenerContainerFactory used to determine whatorg.springframework.jms.listener.AbstractMessageListenerContainer to use to consume messages. Setting this will automatically setconsumerType to Custom.
    messageTimestampEnabledtrueSpecifies whether timestamps should be enabled by default on sending messages.
    passwordnullThe password for the connector factory.
    priority4Values greater than 1 specify the message priority when sending (where 0 is the lowest priority and 9 is the highest). TheexplicitQosEnabled option must also be enabled in order for this option to have any effect.
    pubSubNoLocalfalseSpecifies whether to inhibit the delivery of messages published by its own connection.
    receiveTimeoutNoneThe timeout for receiving messages (in milliseconds).
    recoveryInterval5000Specifies the interval between recovery attempts, i.e. when a connection is being refreshed, in milliseconds. The default is 5000 ms, that is, 5 seconds.
    replyToCacheLevelNameCACHE_CONSUMERCamel 2.9.1: Sets the cache level by name for the reply consumer when doing request/reply over JMS. This option only applies when using fixed reply queues (not temporary). Camel will by default use:CACHE_CONSUMER for exclusive or shared w/ replyToSelectorName. AndCACHE_SESSION for shared without replyToSelectorName. Some JMS brokers such as IBM WebSphere may require to set thereplyToCacheLevelName=CACHE_NONE to work. Note: If using temporary queues thenCACHE_NONE is not allowed, and you must use a higher value such as CACHE_CONSUMER orCACHE_SESSION.
    replyToDestinationSelectorNamenullSets the JMS Selector using the fixed name to be used so you can filter out your own replies from the others when using a shared queue (that is, if you are not using a temporary reply queue).
    replyToDeliveryPersistenttrueSpecifies whether to use persistent delivery by default for replies.
    requestTimeoutCheckerInterval1000Camel 2.9.2: Configures how often Camel should check for timed outExchanges when doing request/reply over JMS.By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the optionrequestTimeout.
    subscriptionDurablefalse@deprecated: Enabled by default, if you specify adurableSubscriberName and a clientId.
    taskExecutornullAllows you to specify a custom task executor for consuming messages.
    taskExecutorSpring2nullCamel 2.6: To use when using Spring 2.x with Camel. Allows you to specify a custom task executor for consuming messages.
    templateConnectionFactorynullThe JMS connection factory used for sending messages.
    transactedInOutfalse@deprecated: Specifies whether to use transacted mode for sending messages using the InOutExchange Pattern. Applies only to producer endpoints. See section Enabling Transacted Consumption for more details.
    transactionManagernullThe Spring transaction manager to use.
    transactionName"JmsConsumer[destinationName]"The name of the transaction to use.
    transactionTimeoutnullThe timeout value of the transaction (in seconds), if using transacted mode.
    transferExceptionfalseIf enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as ajavax.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use CamelJMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also havetransferExchange enabled, this option takes precedence. The caught exception is required to be serializable. The originalException on the consumer side can be wrapped in an outer exception such asorg.apache.camel.RuntimeCamelException when returned to the producer.
    transferExchangefalseYou can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it atWARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an Exchange and not a regular payload.
    usernamenullThe username for the connector factory.
    useMessageIDAsCorrelationIDfalseSpecifies whether JMSMessageID should always be used asJMSCorrelationID for InOut messages.
    useVersion102false@deprecated (removed from Camel 2.5 onwards): Specifies whether the old JMS API should be used.

    ?

    總結

    以上是生活随笔為你收集整理的深入理解DefaultMessageListenerContainer的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。