Azure Service Bus Samples client library for Java

Azure Service Bus samples are a set of self-contained Java programs that demonstrate interacting with Azure Service Bus using the client library. Each sample focuses on a specific scenario and can be executed independently.

Key concepts

Key concepts are explained in detail here.

Getting started

Please refer to the Getting Started section.

Obtaining a Service Bus namespace connection string

Most of the samples authorize with Service Bus using a connection string generated for that Service Bus namespace. The connection string value can be obtained by:

  1. Going to your Service Bus namespace in Azure Portal.
  2. Go to "Shared access policies" for your Service Bus namespace.
  3. Click on the "RootManageSharedAccessKey" policy.
  4. Copying the connection string from the policy's properties.


Asynchronously sending and receiving

Synchronous sending and receiving

Message sessions

Synchronous Administration Client operations

Generate Shared Access Signature

Advanced Configuration


See Troubleshooting.

Next steps

See Next steps.


If you would like to become an active contributor to this project please refer to our Contribution Guidelines for more information.