ActiveMQ(5.10.0) - Connection Configuration URI
An Apache ActiveMQ connection can be configured by explicitly setting properties on the ActiveMQConnection or ActiveMQConnectionFactory objects themselves via the bean properties or using the following URI syntax.
Example
You set the property called jms.$PROPERTY on a regular connection URI. For example you can set the brokerURL on your ActiveMQConnectionFactory to the following value to enable Async Sends
tcp://localhost:61616?jms.useAsyncSend=true
Connection Options
The following options should be prefixed with jms. when used on a URI when connecting to a broker.
| Option Name | Default Value | Description |
| alwaysSessionAsync | true | If this flag is set then a separate thread is used for dispatching messages for each Session in the Connection. However, a separate thread is always used if there is more than one session, or the session isn't in auto acknowledge or dups ok mode |
| checkForDuplicates | true | If this flag is set to true, the consumer will check for duplicate messages and properly handle the message to make sure that it is not processed twice inadvertently. |
| clientID | null | Sets the JMS clientID to use for the connection |
| closeTimeout | 15000ms | Sets the timeout before a close is considered complete. Normally a close() on a connection waits for confirmation from the broker; this allows that operation to timeout to save the client hanging if there is no broker. |
| copyMessageOnSend | true | Should a JMS message be copied to a new JMS Message object as part of the send() method in JMS. This is enabled by default to be compliant with the JMS specification. You can disable it if you do not mutate JMS messages after they are sent for a performance boost. |
| disableTimeStampsByDefault | false | Sets whether or not timestamps on messages should be disabled or not. If you disable them it adds a small performance boost. |
| dispatchAsync | false | Should the broker dispatch messages asynchronously to the consumer. |
| nestedMapAndListEnabled | true | Enables/disables whether or not Structured Message Properties and MapMessages are supported so that Message properties and MapMessage entries can contain nested Map and List objects. Available since version 4.1 onwards |
| objectMessageSerializationDefered | false | When an object is set on an ObjectMessage, the JMS spec requires the object to be serialized by that set method. Enabling this flag causes the object to not get serialized. The object may subsequently get serialized if the message needs to be sent over a socket or stored to disk. |
| optimizeAcknowledge | false | Enables an optimised acknowledgement mode where messages are acknowledged in batches rather than individually. Alternatively, you could use Session.DUPS_OK_ACKNOWLEDGE acknowledgement mode for the consumers which can often be faster. WARNING enabling this issue could cause some issues with auto-acknowledgement on reconnection |
| optimizeAcknowledgeTimeOut | 300ms | if > 0, specifies the max time between batch acks when optimizeAcknowledge is enabled. (since 5.6) |
| optimizedAckScheduledAckInterval | 0 | if > 0, specifies a time interval upon which all the outstanding acks are delivered when optimized acknowledge is used so that a long running consumer that doesn't receive any more messages will eventually ack the last few unacked messages (since 5.7) |
| optimizedMessageDispatch | true | If this flag is set then an larger prefetch limit is used - only applicable for durable topic subscribers |
| useAsyncSend | false | Forces the use of Async Sends which adds a massive performance boost; but means that the send() method will return immediately whether the message has been sent or not which could lead to message loss. |
| useCompression | false | Enables the use of compression of the message bodies |
| useRetroactiveConsumer | false | Sets whether or not retroactive consumers are enabled. Retroactive consumers allow non-durable topic subscribers to receive old messages that were published before the non-durable subscriber started. |
| warnAboutUnstartedConnectionTimeout | 500 | Enables the timeout in milliseconds from a connection creation to when a warning is generated if the connection is not properly started via Connection.start() and a message is received by a consumer. It is a very common gotcha to forget to start the connection and then wonder why no messages are delivered so this option makes the default case to create a warning if the user forgets. To disable the warning just set the value to < 0 (say -1). |
| auditDepth | 2048 | The size of the message window that will be audited (for duplicates and out of order messages |
| auditMaximumProducerNumber | 64 | Maximum number of producers that will be audited |
| alwaysSyncSend | false | When true a MessageProducer will always use Sync sends when sending a Message even if it is not required for the Delivery Mode |
| consumerExpiryCheckEnabled | true | Controls whether message expiration checking is done in each MessageConsumer prior to dispatching a message. Disabling this check can lead to consumption of expired messages. (since 5.11) |
Nested Options
You can also configure nested objects on the connection object using the given prefixes. See the javadoc for a breakdown of each individual property.
| Option Name | Object configured | See Also |
| jms.blobTransferPolicy.* | BlobTransferPolicy | Blob Message |
| jms.prefetchPolicy.* | ActiveMQPrefetchPolicy | What is the prefetch limit for |
| jms.redeliveryPolicy.* | RedeliveryPolicy | Redelivery Policy |
ActiveMQ(5.10.0) - Connection Configuration URI的更多相关文章
- ActiveMQ(5.10.0) - Configuring the JAAS Authentication Plug-in
JAAS provides pluggable authentication, which means ActiveMQ will use the same authentication API re ...
- ActiveMQ 5.10.0 安装与配置
先在官网下载activeMQ,我这里是5.10.0. 然后在解压在一个文件夹下即可. 我这里是:D:\apache-activemq-5.10.0-bin 然后进入bin目录:D:\apache-ac ...
- ActiveMQ(5.10.0) - Building a custom security plug-in
If none of any built-in security mechanisms works for you, you can always build your own. Though the ...
- ActiveMQ(5.10.0) - Spring Support
Maven Dependency: <dependencies> <dependency> <groupId>org.apache.activemq</gro ...
- ActiveMQ(5.10.0) - Configuring the Simple Authentication Plug-in
The easiest way to secure the broker is through the use of authentication credentials placed directl ...
- ActiveMQ(5.10.0) - 删除闲置的队列或主题
方法一 通过 ActiveMQ Web 控制台删除. 方法二 通过 Java 代码删除. ActiveMQConnection.destroyDestination(ActiveMQDestinati ...
- ActiveMQ(5.10.0) - Message Redelivery and DLQ Handling
When messages expire on the ActiveMQ broker (they exceed their time-to-live, if set) or can’t be red ...
- ActiveMQ(5.10.0) - hello world
Sending a JMS message public class MyMessageProducer { ... // 创建连接工厂实例 ConnectionFactory connFactory ...
- ActiveMQ(5.10.0) - Destination-level authorization
To build upon authentication, consider a use case requiring more fine-grained control over clients t ...
随机推荐
- CSS 酷站
http://mikkelbang.com/#!videos
- 转载 JQuery.data()方法学习
转载原地址 http://hanchaohan.blog.51cto.com/2996417/1271551 转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.ht ...
- HDU 3265 Posters (线段树+扫描线)(面积并)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3265 给你n个中间被挖空了一个矩形的中空矩形,让你求他们的面积并. 其实一个中空矩形可以分成4个小的矩 ...
- POJ 2481 Cows (数组数组求逆序对)
题目链接:http://poj.org/problem?id=2481 给你n个区间,让你求每个区间被真包含的区间个数有多少,注意是真包含,所以要是两个区间的x y都相同就算0.(类似poj3067, ...
- C#学习笔记(十五):预处理指令
C#和C/C++一样,也支持预处理指令,下面我们来看看C#中的预处理指令. #region 代码折叠功能,配合#endregion使用,如下: 点击后如下: 条件预处理 条件预处理可以根据给出的条件决 ...
- 负载均衡session共享问题
负载均衡+session共享(memcached-session-manager实现) http://www.cnblogs.com/youzhibing/p/5094460.html http:// ...
- MyEclipse10.0 安装 jbpm4.4
马上送上地址:http://sourceforge.net/projects/jbpm/files/jBPM%204/ 偶这里下载的是 jbpm4.4 如图: 1.点击 add site 2.点击 a ...
- 数据库存取缓冲区的LRU与MRU算法
数据库存取缓冲区的LRU与MRU算法 1.Cache Hit and Cache Miss 当使用者第一次向数据库发出查询数据的请求的时候,数据库会先在缓冲区中查找该数据,如果要访问的数据恰好已经在缓 ...
- 【转】web测试内容及工具经典总结
基于Web的系统测试在基于Web的系统开发中,如果缺乏严格的过程,我们在开发.发布.实施和维护Web的过程中,可能就会碰到一些严重的问题,失败的可能性很大.而且,随着基于Web的系统变得越来越复杂,一 ...
- 用Eclipse来开发STM32
先贴一个官方说明文档:http://www.keil.com/support/man/docs/ecluv/default.htm