Versions Compared

Key

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

...

Where hostname is the hostname of the running rabbitmq instance or cluster. Port is optional and if not specified then defaults to the RabbitMQ client default (5672). The exchange name determines which exchange produced messages will sent to. In the case of consumers, the exchange name determines which exchange the queue will bind to.

Options

Div
classconfluenceTableSmall

Property

Default

Description

autoAck

true

If messages should be auto acknowledged

autoDelete

true

If it is true, the exchange will be deleted when it is no longer in use

durable

true

If we are declaring a durable exchange (the exchange will survive a server restart)

queue

random uuid

The queue to receive messages from

routingKey

null

The routing key to use when binding a consumer queue to the exchange. For producer routing keys, you set the header (see header section)

threadPoolSize

10

The consumer uses a Thread Pool Executor with a fixed number of threads. This setting allows you to set that number of threads.

username

null

username in case of authenticated access

password

null

password for authenticated access

vhost

/

the vhost for the channel

exchangeType

direct

Camel 2.12.2: The exchange type such as direct or topic.

bridgeEndpoint

false

Camel 2.12.3: If the bridgeEndpoint is true, the producer will ignore the message header of

Wiki Markup
{div:class=confluenceTableSmall} || Property || Default || Description || | {{autoAck}} | {{true}} | If messages should be auto acknowledged | | {{autoDelete}} | {{true}} | If it is true, the exchange will be deleted when it is no longer in use | | {{durable}} | {{true}} | If we are declaring a durable exchange (the exchange will survive a server restart) | | {{queue}} | {{random uuid}} | The queue to receive messages from | | {{routingKey}} | {{null}} | The routing key to use when binding a consumer queue to the exchange. For producer routing keys, you set the header (see header section) | | {{threadPoolSize}} | {{10}} | The consumer uses a Thread Pool Executor with a fixed number of threads. This setting allows you to set that number of threads. | | {{username}} | {{null}} | username in case of authenticated access | | {{password}} | {{null}} | password for authenticated access | | {{vhost}} | {{/}} | the vhost for the channel | | {{exchangeType}} | {{direct}} | *Camel 2.12.2:* The exchange type such as direct or topic. | | {{bridgeEndpoint}} | {{false}} | *Camel 2.12.3:* If the bridgeEndpoint is true, the producer will ignore the message header of

"rabbitmq.EXCHANGE_NAME"

and

"rabbitmq.ROUTING_KEY"

| | {{addresses}} | {{null}} | *Camel

addresses

null

Camel 2.12.3:

*

If

this

option

is

set,

camel-rabbitmq

will

try

to

create

connection

based

on

the

setting

of

option

addresses.

The

addresses

value

is

a

string

which

looks

like

"server1:12345,

server2:12345"

| |connectionTimeout | 0| *Camel

connectionTimeout

0

Camel 2.14:

*

Connection

timeout

| |requestedChannelMax | 0| *Camel

requestedChannelMax

0

Camel 2.14:

*

Connection

requested

channel

max

(max

number

of

channels

offered)

| |requestedFrameMax | 0| *Camel

requestedFrameMax

0

Camel 2.14:

*

Connection

requested

frame

max

(max

size

of

frame

offered)

| |requestedHeartbeat | 0| *Camel

requestedHeartbeat

0

Camel 2.14:

*

Connection

requested

heartbeat

(heart-beat

in

seconds

offered)

| |sslProtocol | null | *Camel

sslProtocol

null

Camel 2.14:

*

Enables

SSL

on

connection,

accepted

value

are

`true`,

`TLS`

and

'SSLv3`

| |trustManager | null | *Camel

trustManager

null

Camel 2.14:

*

Configure

SSL

trust

manager,

SSL

should

be

enabled

for

this

option

to

be

effective

| |clientProperties | null | *Camel

clientProperties

null

Camel 2.14:

*

Connection

client

properties

(client

info

used

in

negotiating

with

the

server)

| |connectionFactory | null | *Camel

connectionFactory

null

Camel 2.14:

*

Custom

RabbitMQ

connection

factory.

When

this

option

is

set,

all

connection

options

(connectionTimeout,

requestedChannelMax...)

set

on

URI

are

not

used

| |automaticRecoveryEnabled | false | *Camel

automaticRecoveryEnabled

false

Camel 2.14:

*

Enables

connection

automatic

recovery

(uses

connection

implementation

that

performs

automatic

recovery

when

connection

shutdown

is

not

initiated

by

the

application)

| |networkRecoveryInterval | 5000 | *Camel

networkRecoveryInterval

5000

Camel 2.14:

*

Network

recoverty

interval

in

milliseconds

(interval

used

when

recovering

from

network

failure)

| |topologyRecoveryEnabled | true | *Camel

topologyRecoveryEnabled

true

Camel 2.14:

*

Enables

connection

topology

recovery

(should

topology

recovery

be

performed?)| {div}

performed?)

prefetchEnabled

false

Camel 2.14: Enables the quality of service on the RabbitMQConsumer side, you need to specify the option of prefetchSize, prefetchCount, prefetchGlobal at the same time

prefetchSize

0

Camel 2.14: The maximum amount of content (measured in octets) that the server will deliver, 0 if unlimited.

prefetchCount

0

Camel 2.14: The maximum number of messages that the server will deliver, 0 if unlimited.

prefetchGlobal

false

Camel 2.14: If the settings should be applied to the entire channel rather than each consumer

declaretrueCamel 2.14: If the option is true, camel declare the exchange and queue name and bind them together. If the option is false, camel won't declare the exchange and queue name on the server.

concurrentConsumers

1

Camel 2.14: Number of concurrent consumers when consuming from broker. (eg similar as to the same option for the JMS component).

deadLetterRoutingKey

 

Camel 2.14: The routing key for the dead letter exchange

deadLetterExchange

 

Camel 2.14: The name of the dead letter exchange

deadLetterExchangeType

direct

Camel 2.14: The type of the dead letter exchange

channelPoolMaxSize

10

Camel 2.14.1: (Producer only) Maximum number of channels used to send messages

channelPoolMaxWait

1000

Camel 2.14.1: (Producer only) Maximum time (in milliseconds) waiting for a channel

queueArgsConfigurer

nullCamel 2.15.1: the custom ArgsConfigurer instance which could be used to configure the Args map when declaring the queue.

exchangeArgsConfigurer

null

Camel 2.15.1: the custom ArgsConfigurer instance which could be used to configure the Args map when declaring the exchange.

requestTimeout

20000

Camel 2.16: Producer Only: The timeout for waiting for a reply when using the InOut Exchange Pattern (in milliseconds). The default is 20 seconds. See also the requestTimeoutCheckerInterval option.

requestTimeoutCheckerInterval

1000

Camel 2.16: Configures how often Camel should check for timed out Exchanges when doing request/reply over RabbitMQ. 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 option requestTimeout.

transferException

false

Camel 2.16: If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be sent back in the response as a byte[]. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel RabbitMQ as a bridge in your routing - for example, using persistent queues to enable robust routing. The caught exception is required to be serializable. The original Exception on the consumer side can be wrapped in an outer exception such as org.apache.camel.RuntimeCamelException when returned to the producer.

skipQueueDeclare

falseCamel 2.16.1: If true the producer will not declare and bind a queue. This can be used for directing messages via an existing routing key.
skipExchangeDeclarefalseCamel 2.17.1: This can be used if we need to declare the queue but not the exchange

publisherAcknowledgements

falseCamel 2.17: When true, the message will be published with publisher acknowledgements turned on

publisherAcknowledgementsTimeout

0Camel 2.17: The amount of time in milliseconds to wait for a basic.ack response from RabbitMQ server

See http://www.rabbitmq.com/releases/rabbitmq-java-client/current-javadoc/com/rabbitmq/client/ConnectionFactory.html and the AMQP specification for more information on connection options.

...

Code Block
xml
xml
<bean id="customConnectionFactory" class="com.rabbitmq.client.ConnectionFactory">
  <property name="host" value="localhost"/>
  <property name="port" value="5672"/>
  <property name="username" value="camel"/>
  <property name="password" value="bugsbunny"/>
</bean>
<camelContext>
  <route>
    <from uri="direct:rabbitMQEx2"/>
    <to uri="rabbitmq://localhost:5672/ex2?connectionFactory=#customConnectionFactory"/>
  </route>
</camelContext>


Headers

The following headers are set on exchanges when consuming messages.

Div
classconfluenceTableSmall
Wiki Markup
{div:class=confluenceTableSmall} || Property || Value || | {{

Property

Value

rabbitmq.ROUTING_KEY

}} |

The

routing

key

that

was

used

to

receive

the

message,

or

the

routing

key

that

will

be

used

when

producing

a

message | | {{

message

rabbitmq.EXCHANGE_NAME

}} |

The

exchange

the

message

was

received

from | | {{

from

rabbitmq.DELIVERY_TAG

}} |

The

rabbitmq

delivery

tag

of

the

received message | {div}

received message

rabbitmq.REQUEUECamel 2.14.2: This is used by the consumer to control rejection of the message. When the consumer is complete processing the exchange, and if the exchange failed, then the consumer is going to reject the message from the RabbitMQ broker. The value of this header controls this behavior. If the value is false (by default) then the message is discarded/dead-lettered. If the value is true, then the message is re-queued. 

The following headers are used by the producer. If these are set on the camel exchange then they will be set on the RabbitMQ message.

Div
classconfluenceTableSmall
Wiki Markup
{div:class=confluenceTableSmall} || Property || Value || | {{

Property

Value

rabbitmq.ROUTING_KEY

}} |

The

routing

key

that

will

be

used

when

sending

the

message | | {{

message

rabbitmq.EXCHANGE_NAME

}} |

The

exchange

the

message

was

received

from,

or

sent

to | | {{

to

rabbitmq.CONTENT_TYPE

}} |

The

contentType

to

set

on

the

RabbitMQ

message | | {{

message

rabbitmq.PRIORITY

}} |

The

priority

header

to

set

on

the

RabbitMQ

message | | {{

message

rabbitmq.CORRELATIONID

}} |

The

correlationId

to

set

on

the

RabbitMQ

message | | {{

message

rabbitmq.MESSAGE_ID

}} |

The

message

id

to

set

on

the

RabbitMQ

message | | {{

message

rabbitmq.DELIVERY_MODE

}} |

If

the

message

should

be

persistent

or

not | | {{

not

rabbitmq.USERID

}} |

The

userId

to

set

on

the

RabbitMQ

message | | {{

message

rabbitmq.CLUSTERID

}} |

The

clusterId

to

set

on

the

RabbitMQ

message | | {{

message

rabbitmq.REPLY_TO

}} |

The

replyTo

to

set

on

the

RabbitMQ

message | | {{

message

rabbitmq.CONTENT_ENCODING

}} |

The

contentEncoding

to

set

on

the

RabbitMQ

message | | {{

message

rabbitmq.TYPE

}} |

The

type

to

set

on

the

RabbitMQ

message| | {{

message

rabbitmq.EXPIRATION

}} |

The

expiration

to

set

on

the

RabbitMQ

message | | {{

message

rabbitmq.TIMESTAMP

}} |

The

timestamp

to

set

on

the

RabbitMQ

message | | {{

message

rabbitmq.APP_ID

}} |

The

appId

to

set

on

the

RabbitMQ

message

| {div}

Headers are set by the consumer once the message is received. The producer will also set the headers for downstream processors once the exchange has taken place. Any headers set prior to production that the producer sets will be overriden.

...