This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • AMQP

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Enabling the ActiveMQ Broker for AMQP

It's very easy to enable ActiveMQ for AMQP. Just add a connector to the broker using the amqp URLTo enable AMQP protocol support on the broker add the following transport connector configuration referencing the amqp scheme in its URI:

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

...

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

Example:

Code Block
xml
xml
<transportConnector name="amqp+nio" uri="amqp+nio://localhost:5672"/>

...

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:

Code Block
xml
xml
<transportConnector name="amqp+ssl" uri="amqp+ssl://localhost:5671"/>

...

You should prefix destination address with queue:// to use Queue queue based destinations or topic:// to use topic based destinations. The destination type defaults to queue If when the destination prefix on the destination 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 if client doesn't set it.

You can also tune a default value using prefetch transport attribute, likeExample: tuning the default prefetch size:

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

...

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

 

shortdouble

ShortDouble

 

float

Float

 

int

Integer

 

long

Long

 

short

Short

 

symbol

String

 

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

 

doubleushort

Double

 

float

Float

 

symbol

String

 

binary

String

Hex encoding of the binary valueShort or Integer

Integer is used if: value > Short.MAX_VALUE

HTML Comment

char

String

timestamp

Long

...