Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4E669200B71 for ; Wed, 31 Aug 2016 15:22:36 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4CCDC160AB4; Wed, 31 Aug 2016 13:22:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 55180160A8C for ; Wed, 31 Aug 2016 15:22:33 +0200 (CEST) Received: (qmail 89052 invoked by uid 500); 31 Aug 2016 13:22:32 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 89043 invoked by uid 99); 31 Aug 2016 13:22:32 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Aug 2016 13:22:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 109691A10D3 for ; Wed, 31 Aug 2016 13:22:32 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.374 X-Spam-Level: X-Spam-Status: No, score=0.374 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id xqGCtsiedAQk for ; Wed, 31 Aug 2016 13:22:23 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTP id 137075FAE0 for ; Wed, 31 Aug 2016 13:22:23 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 60EB3E05DC for ; Wed, 31 Aug 2016 13:22:22 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 6F0D53A0D27 for ; Wed, 31 Aug 2016 13:22:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r996348 - in /websites/production/activemq/content: amqp.html cache/main.pageCache stomp.html Date: Wed, 31 Aug 2016 13:22:20 -0000 To: commits@activemq.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160831132221.6F0D53A0D27@svn01-us-west.apache.org> archived-at: Wed, 31 Aug 2016 13:22:36 -0000 Author: buildbot Date: Wed Aug 31 13:22:20 2016 New Revision: 996348 Log: Production update by buildbot for activemq Modified: websites/production/activemq/content/amqp.html websites/production/activemq/content/cache/main.pageCache websites/production/activemq/content/stomp.html Modified: websites/production/activemq/content/amqp.html ============================================================================== --- websites/production/activemq/content/amqp.html (original) +++ websites/production/activemq/content/amqp.html Wed Aug 31 13:22:20 2016 @@ -82,25 +82,25 @@ -

ActiveMQ supports the AMQP 1.0 protocol which is an OASIS standard.

Availability

Available from ActiveMQ version 5.8 onwards.

Enabling the ActiveMQ Broker for AMQP

Its very easy to enable ActiveMQ for AMQP. Just add a connector to the broker using the amqp URL.

+

ActiveMQ supports the AMQP 1.0 protocol which is an OASIS standard.

Availability

Available from ActiveMQ version 5.8 onward.

Enabling the ActiveMQ Broker for AMQP

To enable AMQP protocol support on the broker add the following transport connector configuration referencing the amqp scheme in its URI:

<transportConnectors>
    <transportConnector name="amqp" uri="amqp://0.0.0.0:5672"/>
 </transportConnectors>
 
-

It is enabled in the default ActiveMQ server configuration.

For more help see Run Broker.

Security

The AMQP implementation fully supports an ActiveMQ security mechanism. This means that the broker accepts plain SASL authentication. Also, the authorization policies will be applied when you try to access (read/write) certain destinations.

SSL

For additional security, you can use AMQP over SSL as described in the following section.

Enabling AMQP over NIO

For better scalability (and performance) you might want to run the AMQP protocol over the NIO trans port. To do that just use amqp+nio transport prefix instead of amqp. For example, add the following transport configuration in your XML file:

-
     <transportConnector name="amqp+nio" uri="amqp+nio://localhost:5672"/>
+

It is enabled in the default ActiveMQ server configuration. For more help see Run Broker.

Security

The AMQP implementation fully supports an ActiveMQ security mechanism. This allows the broker to accept plain SASL authentication. Authorization policies are applied to a destination when it's accessed (read/write).

SSL

For additional security AMQP can be configured to run over SSL as described in the following section.

Enabling AMQP over NIO

For better scalability (and performance) the AMQP protocol should be configured to use NIO, rather than the default o f TCP. To use NIO use the transport scheme amqp+nio instead of amqp.

Example:

+
<transportConnector name="amqp+nio" uri="amqp+nio://localhost:5672"/>
 
-

This transport uses the NIO transport underneath and will generally use much less threads than the standard connector. This connector can help if you want to use large number of queues

Enabling AMQP over SSL

It's easy to configure ActiveMQ to use AMQP over a SSL connection. All you have to do is use the amqp+ssl transport prefix instead of amqp. For example, add the following transport configuration in your XML file:

-
     <transportConnector name="amqp+ssl" uri="amqp+ssl://localhost:5671"/>
+

This transport uses the NIO transport underneath and will generally use much less threads than the standard connector. This connector can help if you want to use large number of queues

Enabling AMQP over SSL

It's easy to configure ActiveMQ to use AMQP over a SSL connection. To use SSL use the transport scheme amqp+ssl instead of amqp.

Example:

+
<transportConnector name="amqp+ssl" uri="amqp+ssl://localhost:5671"/>
 
-
  • For more details on using SSL with ActiveMQ, see the following article (How do I use SSL).

Working with Destinations with AMQP

You should prefix destination address with `queue://` to use Queue based destinations or `topic://` to use topic based destinations. If an AMQP address is used without the prefix, it will be used as a Queue.

Prefetch size and credit

When AMQP receiver connects to the broker, its mapped to the JMS consumer. This JMS consumer has to have appropriate prefetch size set. The broker will respect the credit set by the client or use default value of 1000 if client don't set it.

You can also tune a default value using pref etch transport attribute, like

-
<transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600&amp;transport.prefetch=10"/>
-

In this case, client preference will be ignored and the configured value will be used.

You can also tune broker-side amqp receiver link that handles incoming messages. It will use credit of 1000 messages by default, but you can override this by using producerCredit property, like 

-
<transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600&amp;transport.producerCredit=10000"/>
-

Mapping to JMS

There are three basic conversion strategies that can be used with AMQP and interoperating with the JMS API.

Strategy

Description

native

Default Wraps the bytes of the AMQP message into a JMS BytesMessage and
also maps the headers of the AMQP message to headers on the JMS message

raw

Wraps the bytes of the AMQP message into a JMS BytesMessage

jms

Maps headers of the AMQP message to JMS message headers and maps the
body of the AMQP message to JMS body

Set the transformer transport option on the transportConnector to the desired mapping strategy. For example, to interoperate with JMS at the payload level, set the transformer option to jms

-
     <transportConnector name="amqp" uri="amqp://localhost:5672?transport.transformer=jms"/>
+

For more details on using SSL with ActiveMQ, see the following article (How do I use SSL).

Working with Destinations with AMQP

You should prefix destination address with queue:// to use queue based destinations or topic:// to use topic based destinations. The destination type defaults to queue when the destination prefix is omitted.

Prefetch Size and Credit

When AMQP receiver connects to the broker it's mapped to the JMS consumer. This JMS consumer has to have appropriate prefetch size set. The broker will honor the credit set by the client or use the default value of 1000< /strong> if client doesn't set it.

Example: tuning the default prefetch size:

+
<transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600&amp;transport.prefetch=10"/>
+

In this case, client preference will be ignored and the configured value will be used.

You can also tune broker-side amqp receiver link that handles incoming messages. It will use credit of 1000 messages by default, but you can override this by using producerCredit property, like 

+
<transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600&amp;transport.producerCredit=10000"/>
+

Mapping to JMS

There are three basic conversion strategies that can be used with AMQP and inter-operating with the JMS API.

Strategy

Description

native

(Default) Wraps the bytes of the AMQP message into a JMS BytesMessage and maps the headers of the AMQP message to headers on the JMS message.

raw

Wraps the bytes of the AMQP message into a JMS BytesMessage.

jms

Maps headers of the AMQP message to JMS message headers and the body of the AMQP message to the JMS body.

Set the transformer transport option on the transportConnector to the desired mapping strategy. For example, to inter-operate with JMS at the payload level, set the transformer option to jms:

+
<transportConnector name="amqp" uri="amqp://localhost:5672?transport.transformer=jms"/>
 
-

How AMQP message headers are mapped to JMS Headers:

The following headers are mapped regardless of the transformer used:

AMQP Message

JMS Message

Notes

 

JMS_AMQP_NATIVE

Will be set to true if the transformer is 'native' or 'raw', false otherwise.

message-format

JMS_AMQP_MESSAGE_FORMAT

 

The following headers are mapped if the transformer is 'native' or 'jms':

AMQP Message

JMS Message

Notes

header.durable

JMSDeliveryMode

javax.jms.Message.DEFAULT_DELIVERY_MODE if not set

header.priority

JMSPriority

javax.jms.Message.DEFAULT_PRIORITY if not set

header.ttl

JMSExpiration

javax.jms.Message.DEFAULT_TIME_TO_LIVE if not set

header.first-acquirer

JMS_AMQP_FirstAcquirer

 

header.deliveryCount

JMSXDeliveryCount

delivery-annotations.name

JMS_AMQP_DA_name

 

message-annotations.x-opt-jms-type

JMSType

 

message-annotations.x-opt-to-type

Type of the JMSDestination

Comma separated list of 'queue', 'topic', or 'temporary', defaults to queue if not set.

message-annotations.x-opt-reply-type

Type of the JMSReplyTo

Comma separated list of 'queue', 'topic', or 'temporary', defaults to queue if not set.

message-annotations.name

JMS_AMQP_MA_name

 

application-properties.JMSXGroupID

JMSXGroupID

 

application-properties.JMSXGroupSequence

JMSXGroupSequence

 

application-properties.JMSXUserID

JMSXUserID

 

application-properties.name

name

 

properties.message-id

JMSMessageID

Auto generated if not set

properties.user-id

JMSXUserID

properties.user-id is decoded as a UTF-8 String

properties.to

JMSDestination

The name of the JMSDestination

properties.subject

JMS_AMQP_Subject

 

properties.reply-to

JMSReplyTo

The name of the JMSReplyTo

properties.correlation-id

JMSCorrelationID

 

properties.content-type

J MS_AMQP_ContentType

 

properties.content-encoding

JMS_AMQP_ContentEncoding

 

properties.creation-time

JMSTimestamp

 

properties.group-sequence

JMSXGroupSequence

 

properties.reply-to-group-id

JMS_AMQP_ReplyToGroupID

 

footer.name

JMS_AMQP_FT_name

 

AMQP property value types are converted as follows:

AMQP Type

Java Type

Notes

bool

Boolean

 

byte

Byte

 

short

Short

 

int

Integer

 

long

Long

 

ubyte

Byte or Short

Short is used if value > Byte.MAX_VALUE

ushort

Short or Integer

Integer is used if value > Short.MAX_VALUE

uint

Integer or Long

Long is used if value > Integer.MAX_VALUE

ulong

Long

 

double

Double

&# 160;

float

Float

 

symbol

String

 

binary

String

Hex encoding of the binary value

 

 

 

 

 

 

 

 

How AMQP messages bodies are mapped to JMS Messages:

If the transformer is set to 'jms', the they type of JMS message will depend on the body type of the AMQP message.

Body Type

JMS Message Type

null

Message

Data

BytesMessage

AmqpSequence

StreamMessage

AmqpValue holding a null

Message

AmqpValue holding a String

TextMessage

AmqpValue holding a binary

BytesMessage

AmqpValue holding a list

StreamMessage

AmqpValue

ObjectMessage

AMQP 1.0 client library

You can use Apache Qpid Proton.

+

How AMQP Message Headers are Mapped to JMS Headers

The following headers are mapped regardless of the transformer used:

AMQP Message

JMS Message

Notes

 

JMS_AMQP_NATIVE

Will be set to true if the transformer is native or rawfalse otherwise.

message-format

JMS_AMQP_MESSAGE_FORMAT

 

The following header mappings apply when the transformer is either native or jms:

 

AMQP Message

JMS Message

Notes

application-properties.JMSXGroupID

JMSXGroupID

 

application-properties.JMSXGroupSeq uence

JMSXGroupSequence

 

application-properties.JMSXUserID

JMSXUserID

 

application-properties.name

name

 

delivery-annotations.name

JMS_AMQP_DA_name

footer.name

JMS_AMQP_FT_name

 

header.deliveryCount

JMSXDeliveryCount

 

header.durable

JMSDeliveryMode

javax.jms.Message.DEFAULT_DELIVERY_MODE if not set.

header.first-acquirer

JMS_AMQP_FirstAcquirer

 

header.priority

JMSPriority

javax.jms.Message.DEFAULT_PRIORITY if not set.

header.ttl

JMSExpiration

javax.jms.Message.DEFAULT_TIME_TO_LIVE if not set.

message-annotations.name

JMS_AMQP_MA_name

 

message-annotations.x-opt-jms-type

JMSType

 

message-annotations.x-opt-reply-type

Type of the JMSReplyTo

Comma separated list of queue, topic, or temporary. Defaults to queue if not set.

messag e-annotations.x-opt-to-type

Type of the JMSDestination

Comma separated list of queue, topic, or temporary. Defaults to queue if not set.

properties.content-encoding

JMS_AMQP_ContentEncoding

 

properties.content-type

JMS_AMQP_ContentType

 

properties.correlation-id

JMSCorrelationID

 

properties.creation-time

JMSTimestamp

 

properties.group-sequence

JMSXGroupSequence

 

properties.message-id

JMSMessageID

Auto generated if not set.

properties.reply-to

JMSReplyTo

The name of the JMSReplyTo

properties.reply-to-group-id

JMS_AMQP_ReplyToGroupID

 

properties.subject

JMS_AMQP_Subject

 

properties.to

JMSDestination

The name of the JMSDestination

properties.user-id

JMSXUserID

properties.user-id is decoded as a UTF-8 String.

 

AMQP property value types are converted as follows:

AMQP Type

Java Type

Notes

binary

String

Hex encoding of the binary value

bool

Boolean

 

byte

Byte

 

double

Double

 

float

Floa t

 

int

Integer

 

long

Long

 

short

Short

 

symbol

String

 

ubyte

Byte or Short

Short is used if: value > Byte.MAX_VALUE

uint

Integer or Long

Long is used if: value > Integer.MAX_VALUE

ulong

Long

 

ushort

Short or Integer

Integer is used if: value > Short.MAX_VALUE

How a AMQP Messages Body is Mapped to a JMS Message

If the transformer is set to jms then the JMS message type will depend on the body type of the AMQP message.

Body Type

JMS Message Type

AmqpSequence

StreamMessage

AmqpValue

ObjectMessage

AmqpValue holding a null

Message

AmqpValue holding a String

TextMessage

AmqpValue holding a binary

BytesMessage

Amq pValue holding a list

StreamMessage

Data

BytesMessage

null

Message

AMQP 1.0 client library

You can use Apache Qpid Proton.