Camel Spring Boot

Azure ServiceBus

Send and receive messages to/from Azure Service Bus.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-azure-servicebus-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 32 options, which are listed below.

Name Description Default Type

camel.component.azure-servicebus.amqp-retry-options

The AmqpRetryOptions of the Service Bus clients: the retry mode, the maximum number of retries, the delay and maximum delay between retries, and the try timeout of an operation. When not set, the SDK retries 3 times with an exponential delay from 0.8 seconds up to 1 minute, and a try timeout of 60 seconds. The option is a com.azure.core.amqp.AmqpRetryOptions type.

AmqpRetryOptions

camel.component.azure-servicebus.amqp-transport-type

The AmqpTransportType of the connection to Service Bus: AMQP (AMQP over TLS on port 5671) or AMQP_WEB_SOCKETS (AMQP over web sockets on port 443, needed with proxyOptions or when port 5671 is blocked).

amqp

AmqpTransportType

camel.component.azure-servicebus.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.azure-servicebus.binary

Whether the producer sends the body as bytes: a stream or a file (File or Path) as read, and any other body converted to byte[]. When false, the body is converted to a String. A BinaryData body is sent as it is either way. Applies to each element of a List body too.

false

Boolean

camel.component.azure-servicebus.bridge-error-handler

Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.

false

Boolean

camel.component.azure-servicebus.client-options

The ClientOptions of the Service Bus clients: the application id that is sent in the user agent, and the tracing and metrics options. An AmqpClientOptions also sets the identifier of the clients. The option is a com.azure.core.util.ClientOptions type.

ClientOptions

camel.component.azure-servicebus.configuration

The configuration that the endpoints of this component start from: each endpoint uses a copy of it, with the options of its URI set on top. The option is a org.apache.camel.component.azure.servicebus.ServiceBusConfiguration type.

ServiceBusConfiguration

camel.component.azure-servicebus.connection-string

Sets the connection string for a Service Bus namespace or a specific Service Bus resource. Connection strings commonly contain characters with a special meaning in URIs (the SharedAccessKey is a Base64 value that may contain plus, slash or equals characters): when configuring the connection string directly in an endpoint URI, wrap the value with RAW() so it is not URI-decoded.

String

camel.component.azure-servicebus.credential-type

Determines the credential strategy to adopt: CONNECTION_STRING, TOKEN_CREDENTIAL with the tokenCredential option, or AZURE_IDENTITY with a DefaultAzureCredential: the tokenCredential option when it is set, otherwise a new one. When not set, it is TOKEN_CREDENTIAL (or AZURE_IDENTITY for a DefaultAzureCredential) when tokenCredential is set, else CONNECTION_STRING.

connection-string

CredentialType

camel.component.azure-servicebus.enable-dead-lettering

Dead-letters the message of a failed exchange instead of abandoning it, with the exception as the dead-letter reason and its stack trace as the error description. The message goes to the dead-letter queue of the queue or subscription it was received from. Applies only in PEEK_LOCK receive mode, and not when reading a sub-queue (subQueue), where the message is abandoned.

false

Boolean

camel.component.azure-servicebus.enabled

Whether to enable auto configuration of the azure-servicebus component. This is enabled by default.

Boolean

camel.component.azure-servicebus.fully-qualified-namespace

The fully qualified namespace of the Service Bus, such as mynamespace.servicebus.windows.net, to connect to with credentialType TOKEN_CREDENTIAL or AZURE_IDENTITY. Not used to connect with CONNECTION_STRING, where the connection string holds the namespace.

String

camel.component.azure-servicebus.header-filter-strategy

The HeaderFilterStrategy that decides which Camel message headers the producer sends as application properties of the message, and which application properties of a received message the consumer sets as headers. The default leaves out names that start with Camel or camel, and the producer sends only headers with a value of type String, Boolean, Byte, Short, Integer, Long, Float, Double, Character, Date or UUID. The option is a org.apache.camel.spi.HeaderFilterStrategy type.

HeaderFilterStrategy

camel.component.azure-servicebus.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean

camel.component.azure-servicebus.max-auto-lock-renew-duration

How long the consumer keeps renewing the lock of a message while its exchange is in progress, in PEEK_LOCK receive mode, as a duration (such as 10m or PT10M) or in milliseconds. The lock is renewed shortly before it expires, until the exchange completes or this time has passed. 0 turns renewal off, so Service Bus delivers a message again when its exchange takes longer than the lock duration of the queue or subscription. With sessionEnabled, it is how long the SDK keeps renewing the session lock instead. Not used in RECEIVE_AND_DELETE receive mode. The option is a long type.

300000

Long

camel.component.azure-servicebus.max-concurrent-calls

The maximum number of messages that the processor client hands to the route at the same time (concurrent calls of its message callback), at least 1. With sessionEnabled it is per session, so up to maxConcurrentSessions times maxConcurrentCalls messages. A call ends when the route continues asynchronously, so an asynchronous route can have more exchanges in flight.

1

Integer

camel.component.azure-servicebus.max-concurrent-sessions

The maximum number of sessions the consumer processes at the same time, each with up to maxConcurrentCalls messages at the same time. Only used when sessionEnabled is true.

1

Integer

camel.component.azure-servicebus.prefetch-count

The number of messages the processor client fetches from Service Bus ahead of the ones it is processing. 0 (the default) turns prefetch off: the consumer asks for a message only when a call is free to process it. In PEEK_LOCK receive mode, the lock of a prefetched message already runs while the message waits in the buffer.

Integer

camel.component.azure-servicebus.processor-client

A ServiceBusProcessorClient to use instead of one that the consumer builds. The consumer only starts it, and stops it (without closing it) when the consumer stops: the client hands its messages to the processMessage callback it was built with, not to the route, and the consumer options (such as serviceBusReceiveMode, maxAutoLockRenewDuration or enableDeadLettering) do not apply to it. The option is a com.azure.messaging.servicebus.ServiceBusProcessorClient type.

ServiceBusProcessorClient

camel.component.azure-servicebus.producer-operation

The operation of the producer: sendMessages sends the message (or each element of a List body) at once, scheduleMessages schedules it to be enqueued at scheduledEnqueueTime. The CamelAzureServiceBusProducerOperation header overrides it.

sendmessages

ServiceBusProducerOperationDefinition

camel.component.azure-servicebus.proxy-options

The ProxyOptions of the proxy to connect to Service Bus through, for the producer and the consumer. A proxy needs amqpTransportType AMQP_WEB_SOCKETS: with AMQP the client fails to build. When not set, the SDK uses a proxy from its environment configuration, if one is configured. The option is a com.azure.core.amqp.ProxyOptions type.

ProxyOptions

camel.component.azure-servicebus.scheduled-enqueue-time

Sets OffsetDateTime at which the message should appear in the Service Bus queue or topic. Used only by the scheduleMessages producer operation; sendMessages sends the message at once. In an endpoint URI or a property use an ISO-8601 date-time with an offset, such as 2026-11-18T22:00:00Z or 2026-11-18T23:00:00+01:00.

OffsetDateTime

camel.component.azure-servicebus.sender-client

A ServiceBusSenderClient to use instead of one that the producer builds. It sends to the queue or topic it was built for, so the connection options (such as connectionString, serviceBusType and topicOrQueueName) do not apply to it, and the producer does not close it. The option is a com.azure.messaging.servicebus.ServiceBusSenderClient type.

ServiceBusSenderClient

camel.component.azure-servicebus.service-bus-receive-mode

How the consumer receives messages. PEEK_LOCK: Service Bus locks each message, and the consumer completes it when its exchange succeeds, or abandons it (dead-letters it with enableDeadLettering) when the exchange fails, so that Service Bus delivers it again, up to the maximum delivery count of the queue or subscription. RECEIVE_AND_DELETE: Service Bus deletes each message when it delivers it, so the message of a failed exchange is lost.

peek-lock

ServiceBusReceiveMode

camel.component.azure-servicebus.service-bus-transaction-context

The ServiceBusTransactionContext (the id of a transaction created with createTransaction() of a Service Bus client) to send or schedule the messages in. The producer does not commit or roll back the transaction. The CamelAzureServiceBusServiceBusTransactionContext header overrides it. The option is a com.azure.messaging.servicebus.ServiceBusTransactionContext type.

ServiceBusTransactionContext

camel.component.azure-servicebus.service-bus-type

Whether topicOrQueueName is the name of a queue or of a topic. The consumer of a topic receives from the subscription set in subscriptionName.

queue

ServiceBusType

camel.component.azure-servicebus.session-enabled

Whether the consumer receives from a session-enabled queue or subscription, with a session processor client: it locks a session and receives the messages of that session in order, up to maxConcurrentSessions sessions at the same time. Needed to receive from a session-enabled queue or subscription.

false

Boolean

camel.component.azure-servicebus.session-id

The session id that the producer sets on every message it sends, as a session-enabled queue or topic needs one. The CamelAzureServiceBusSessionId header is not used.

String

camel.component.azure-servicebus.session-idle-timeout

How long a session-enabled consumer waits for the next message of a session before it closes the session and tries to lock another one, as a duration (such as 30s or PT30S) or in milliseconds. 0 or less (the default is -1) keeps the default of the Service Bus SDK. Only used when sessionEnabled is true. An idle session holds one of the maxConcurrentSessions slots for this long, so use a value that just covers the slowest asynchronous route. The option is a long type.

-1

Long

camel.component.azure-servicebus.sub-queue

The sub-queue of the queue or subscription to receive from: DEAD_LETTER_QUEUE (the dead-letter queue) or TRANSFER_DEAD_LETTER_QUEUE (the transfer dead-letter queue). When not set, or NONE, the consumer receives from the queue or subscription itself.

SubQueue

camel.component.azure-servicebus.subscription-name

Sets the name of the subscription in the topic to listen to. topicOrQueueName and serviceBusType=topic must also be set. This property is required if serviceBusType=topic and the consumer is in use.

String

camel.component.azure-servicebus.token-credential

The com.azure.core.credential.TokenCredential to authenticate with Microsoft Entra ID, for credentialType TOKEN_CREDENTIAL or AZURE_IDENTITY. A DefaultAzureCredential built with a managed identity client id or a tenant id is used as it is. The option is a com.azure.core.credential.TokenCredential type.

TokenCredential