Azure Service Bus Java Client Generally Available

The Azure Service Bus team is extremely excited to announce general availability of our Java client library version 1.0.0. It allows customers to enjoy a solid Java experience with Azure Service Bus as it comes complete with native functionality.

Want to use the native client to send scheduled messages? No problem. Want to use sessions on Standard and Premium plans to keep your messages in order? Sure thing.

We had a number of organizations and individuals motivating us to get this out the door. Thank you to them for the patience and the push!

Our Java client (Java 8) is also now on par with our .NET Standard client library (.NET Standard 1.3) and if you were to use both you would notice feature parity and full support for interacting with Azure Service Bus.

Service Bus Java Samples

In order to run the samples below, replace the following bracketed values in the [sample].java file.

For queue samples

private static final String connectionString = "{connection string}";
private static final String queueName = "{queue name}";

For topic samples

private static final String connectionString = "{connection string}";
private static final String topicName = "{topic name}";
private static final String subscriptionName = "{subscription name}";

Prerequisites

Java 8
An Azure subscription.
A Service Bus namespace
A Service Bus queue
Or A Service Bus topic

The samples are available here

Send and receive messages with Queue using QueueClient

This sample demonstrates how to use QueueClient to connect to a queue and then send and receive messages with this QueueClient. It uses MessageHandler (aka MessagePump) model which simplifies the processing model for messages.

Send and receive messages with Topic Subscription using TopicClient and Subscription Client

This sample demonstrates how to use TopicClient and SubscriptionClient to connect to a Topic and its Subscription and send and receive messages. It uses MessageHandler (aka MessagePump) model which simplifies the processing model for messages.

Send and receive messages with Queue using MessageSender and MessageReceiver

This sample demonstrates how to use MessageSender and MessageReceiver to send and receive messages from a Service Bus Queue. With sender and receiver, the client could have full control of how the messages are sent and processed.

Send messages with Qpid JMS and Receive with Service Bus Java Client

This sample demonstrates how to send messages via Qpid JMS to Azure Serivce Bus and receive messages with Service Bus Java client. Please note: only BytesMessage is supported currently, we'll be adding more support later for this such as TextMessage.

Open Source

This client is open source and if you want to contribute you can! You can submit a code fix for a bug, submit a new feature request and provide other feedback in our GitHub repo.

You can find the Maven package here and documentation here.
Quelle: Azure

Published by