See: Description
| Package | Description |
|---|---|
| com.azure.spring.servicebus.stream.binder |
Package com.azure.spring.servicebus.stream.binder
|
| com.azure.spring.servicebus.stream.binder.config |
Package com.azure.spring.servicebus.stream.binder.config;
|
| com.azure.spring.servicebus.stream.binder.properties |
Package com.azure.spring.servicebus.stream.binder.properties;
|
| com.azure.spring.servicebus.stream.binder.provisioning |
Package com.azure.spring.servicebus.stream.binder.provisioning;
|
The project provides Spring Cloud Stream Binder for Azure Service Bus Queue which allows you to build message-driven microservice using Spring Cloud Stream based on Azure Service Bus Queue.
Source code | Package (Maven) | API reference documentation | Product documentation | Samples
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-cloud-stream-binder-servicebus-queue</artifactId>
<version>2.4.0</version>
</dependency>
The Spring Cloud Stream Binder for Azure Service Bus Queue provides the binding implementation for the Spring Cloud Stream.
This implementation uses Spring Integration Service Bus Queue Channel Adapters at its foundation.
This binder supports submitting messages to a queue for delayed processing. Users can send scheduled messages with header x-delay
expressing in milliseconds a delay time for the message. The message will be delivered to the respective queues after x-delay milliseconds.
This binder has no consumer group support since all consumers share one queue.
This binder has no partition support even service bus queue supports partition.
The binder provides the following configuration options:
Name | Description | Required | Default ---|---|---|--- spring.cloud.azure.credential-file-path | Location of azure credential file | Yes | spring.cloud.azure.resource-group | Name of Azure resource group | Yes | spring.cloud.azure.region | Region name of the Azure resource group, e.g. westus | Yes | spring.cloud.azure.servicebus.namespace | Service Bus Namespace. Auto creating if missing | Yes |
It supports the following configurations with the format of spring.cloud.stream.servicebus.queue.bindings.<channelName>.producer.
sync
Whether the producer should act in a synchronous manner with respect to writing messages into a stream. If true, the producer will wait for a response after a send operation.
Default: false
send-timeout
Effective only if sync is set to true. The amount of time to wait for a response after a send operation, in milliseconds.
Default: 10000
It supports the following configurations with the format of spring.cloud.stream.servicebus.queue.bindings.<channelName>.consumer.
checkpoint-mode
The mode in which checkpoints are updated.
RECORD, checkpoints occur after each record successfully processed by user-defined message handler without any exception.
MANUAL, checkpoints occur on demand by the user via the Checkpointer. You can get Checkpointer by Message.getHeaders.get(AzureHeaders.CHECKPOINTER)callback.
Default: RECORD
prefetch-count
Prefetch count of underlying service bus client.
Default: 1
concurrency
Controls the max concurrent calls of service bus message handler and the size of fixed thread pool that handles user's business logic
Default: 1
sessionsEnabled
Controls if is a session aware consumer. Set it to true if is a queue with sessions enabled.
Default: false
requeueRejected
Controls if is a message that trigger any exception in consumer will be force to DLQ.
Set it to true if a message that trigger any exception in consumer will be force to DLQ.
Set it to false if a message that trigger any exception in consumer will be re-queued.
Default: false
Please use this sample as a reference for how to use this binder in your projects.
- Service Bus Queue
Spring allow all the supported logging systems to set logger levels set in the Spring Environment (for example, in application.properties) by using
logging.level.<logger-name>=<level> where level is one of TRACE, DEBUG, INFO, WARN, ERROR, FATAL, or OFF.
The root logger can be configured by using logging.level.root.
The following example shows potential logging settings in application.properties:
logging.level.root=WARN
logging.level.org.springframework.web=DEBUG
logging.level.org.hibernate=ERROR
For more information about setting logging in spring, please refer to the official doc.
The following section provides sample projects illustrating how to use the starter in different cases.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
Please follow instructions here to build from source or contribute.
Copyright © 2021 Microsoft Corporation. All rights reserved.