ActiveMQ (5.10.0)-Connection Configuration URI

Source: Internet
Author: User
Tags prefetch

An Apache ActiveMQ connection can is configured by explicitly setting properties on the Activemqconnection or Activemqconn Ectionfactory objects themselves via the bean properties or using the following URI syntax.

Example

You set the property called JMS. $PROPERTY a regular connection URI. For example you can set the Brokerurl in your activemqconnectionfactory to the following value to enable Async sends

Tcp://localhost:61616?jms.useasyncsend=true

Connection Options

The following options should is prefixed with JMS. when used on a URI is connecting to a broker.

Option Name Default Value Description
Alwayssessionasync True IF This flag was set then a separate thread was used for dispatching messages for each Session in the Connection. However, a separate thread is all used if there is more than one session, or the session isn ' t in auto acknowledge or D UPS OK mode
Checkforduplicates True IF This flag was set to true, the consumer would check for duplicate messages and properly handle the message to make sure T Hat 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, operation to timeout to save the client hanging if there is no broker.
Copymessageonsend True Should a JMS message is copied to a new JMS message object as part of the Send () method in JMS. This was enabled by default to being compliant with the JMS specification. You can disable it if you don't mutate JMS messages after they is sent for a performance boost.
Disabletimestampsbydefault False Sets whether or not timestamps on messages should is 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 is supported so that message properties and Mapmessage entries can contain nested MAP and List objects. Available since version 4.1 onwards
Objectmessageserializationdefered False When a object is set on a objectmessage, the JMS spec requires the object to being 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 is sent over a socket or stored to disk.
Optimizeacknowledge False Enables an optimised acknowledgement mode where messages is acknowledged in batches rather than individually.  Alternatively, you could use Session.dups_ok_acknowledge acknowledgement mode for the consumers which can often is 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 was delivered when optimized acknowledge was used So, a long running consumer that doesn ' t receive any more messages would eventually ack the last few unacked messages ( Since 5.7)
Optimizedmessagedispatch True IF This flag was set then a 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 would return immediately whether the message has been sent or not which could leads to mess Age loss.
Usecompression False Enables the use of compression of the message bodies
Useretroactiveconsumer False Sets whether or not retroactive consumers is enabled. Retroactive consumers allow Non-durable topic subscribers to receive old messages that were published before the Non-durab Le subscriber started.
Warnaboutunstartedconnectiontimeout 500 Enables the timeout in milliseconds from a connection creation to when a warning is generated if the connection are not pro Perly started via Connection.start () and a message are received by a consumer. It is a very common gotcha to forget to start the connection and then wonder why no messages be 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 would be is audited (for duplicates and out of order messages
Auditmaximumproducernumber 64 Maximum number of producers that'll be audited
Alwayssyncsend False When true a messageproducer'll always use Sync sends when sending a Message even if it's not required for the Delivery Mode
Consumerexpirycheckenabled True Controls whether message expiration checking is done with each messageconsumer prior to dispatching a message. Disabling this check can leads 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's the prefetch limit for
Jms.redeliverypolicy.* Redeliverypolicy Redelivery Policy

ActiveMQ (5.10.0)-Connection Configuration URI

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.