ServiceBusAdministrationAsyncClient Class

Definition

  • java.lang.Object
    • com.azure.messaging.servicebus.administration.ServiceBusAdministrationAsyncClient

An asynchronous client for managing a Service Bus namespace. Instantiated via ServiceBusAdministrationClientBuilder.

Create a queue

// `.subscribe()` is a non-blocking call. It'll move onto the next
 // instruction after setting up the `consumer` and `errorConsumer` callbacks.
 client.createQueue("my-new-queue").subscribe(queue -> {
     System.out.printf("Queue created. Name: %s. Lock Duration: %s.%n",
         queue.getName(), queue.getLockDuration());
 }, error -> {
         System.err.println("Error creating queue: " + error);
     });

Edit an existing subscription

// To update the subscription we have to:
 // 1. Get the subscription info from the service.
 // 2. Update the SubscriptionProperties we want to change.
 // 3. Call the updateSubscription() with the updated object.

 // `.subscribe()` is a non-blocking call. It'll move onto the next
 // instruction after setting up the `consumer` and `errorConsumer` callbacks.
 client.getSubscription("my-topic", "my-subscription")
     .flatMap(subscription -> {
         System.out.println("Original delivery count: " + subscription.getMaxDeliveryCount());

         // Updating it to a new value.
         subscription.setMaxDeliveryCount(5);

         // Persisting the updates to the subscription object.
         return client.updateSubscription(subscription);
     })
     .subscribe(subscription -> {
         System.out.printf("Subscription updated. Name: %s. Delivery count: %s.%n",
             subscription.getSubscriptionName(), subscription.getMaxDeliveryCount());
     }, error -> {
             System.err.println("Error updating subscription: " + error);
         });

List all queues

// `.subscribe()` is a non-blocking call. It'll move onto the next
 // instruction after setting up the `consumer` and `errorConsumer` callbacks.
 client.listQueues().subscribe(queue -> {
     System.out.printf("Queue [%s]. Lock Duration: %s.%n",
         queue.getName(), queue.getLockDuration());
 }, error -> {
         System.err.println("Error fetching queues: " + error);
     });
public final class ServiceBusAdministrationAsyncClient

Methods

createQueue(String queueName)

Creates a queue with the given name.

createQueue(String queueName, CreateQueueOptions queueOptions)

Creates a queue with the CreateQueueOptions and given queue name.

createQueueWithResponse(String queueName, CreateQueueOptions queueOptions)

Creates a queue and returns the created queue in addition to the HTTP response.

createRule(String topicName, String subscriptionName, String ruleName)

Creates a rule under the given topic and subscription

createRule(String topicName, String subscriptionName, String ruleName, CreateRuleOptions ruleOptions)

Creates a rule with the CreateRuleOptions.

createRuleWithResponse(String topicName, String subscriptionName, String ruleName, CreateRuleOptions ruleOptions)

Creates a rule and returns the created rule in addition to the HTTP response.

createSubscription(String topicName, String subscriptionName)

Creates a subscription with the given topic and subscription names.

createSubscription(String topicName, String subscriptionName, CreateSubscriptionOptions subscriptionOptions)

Creates a subscription with the CreateSubscriptionOptions.

createSubscriptionWithResponse(String topicName, String subscriptionName, CreateSubscriptionOptions subscriptionOptions)

Creates a subscription and returns the created subscription in addition to the HTTP response.

createTopic(String topicName)

Creates a topic with the given name.

createTopic(String topicName, CreateTopicOptions topicOptions)

Creates a topic with the CreateTopicOptions.

createTopicWithResponse(String topicName, CreateTopicOptions topicOptions)

Creates a topic and returns the created topic in addition to the HTTP response.

deleteQueue(String queueName)

Deletes a queue the matching queueName.

deleteQueueWithResponse(String queueName)

Deletes a queue the matching queueName and returns the HTTP response.

deleteRule(String topicName, String subscriptionName, String ruleName)

Deletes a rule the matching ruleName.

deleteRuleWithResponse(String topicName, String subscriptionName, String ruleName)

Deletes a rule the matching ruleName and returns the HTTP response.

deleteSubscription(String topicName, String subscriptionName)

Deletes a subscription the matching subscriptionName.

deleteSubscriptionWithResponse(String topicName, String subscriptionName)

Deletes a subscription the matching subscriptionName and returns the HTTP response.

deleteTopic(String topicName)

Deletes a topic the matching topicName.

deleteTopicWithResponse(String topicName)

Deletes a topic the matching topicName and returns the HTTP response.

getNamespaceProperties()

Gets information about the Service Bus namespace.

getNamespacePropertiesWithResponse()

Gets information about the Service Bus namespace along with its HTTP response.

getQueue(String queueName)

Gets information about the queue.

getQueueExists(String queueName)

Gets whether or not a queue with queueName exists in the Service Bus namespace.

getQueueExistsWithResponse(String queueName)

Gets whether or not a queue with queueName exists in the Service Bus namespace.

getQueueRuntimeProperties(String queueName)

Gets runtime properties about the queue.

getQueueRuntimePropertiesWithResponse(String queueName)

Gets runtime properties about the queue along with its HTTP response.

getQueueWithResponse(String queueName)

Gets information about the queue along with its HTTP response.

getRule(String topicName, String subscriptionName, String ruleName)

Gets a rule from the service namespace. Only following data types are deserialized in Filters and Action parameters - string, int, long, boolean, double, and OffsetDateTime. Other data types would return its string value.

getRuleWithResponse(String topicName, String subscriptionName, String ruleName)

Gets a rule from the service namespace. Only following data types are deserialized in Filters and Action parameters - string, int, long, bool, double, and OffsetDateTime. Other data types would return its string value.

getSubscription(String topicName, String subscriptionName)

Gets information about the queue.

getSubscriptionExists(String topicName, String subscriptionName)

Gets whether or not a subscription within a topic exists.

getSubscriptionExistsWithResponse(String topicName, String subscriptionName)

Gets whether or not a subscription within a topic exists.

getSubscriptionRuntimeProperties(String topicName, String subscriptionName)

Gets runtime properties about the subscription.

getSubscriptionRuntimePropertiesWithResponse(String topicName, String subscriptionName)

Gets runtime properties about the subscription.

getSubscriptionWithResponse(String topicName, String subscriptionName)

Gets information about the subscription along with its HTTP response.

getTopic(String topicName)

Gets information about the topic.

getTopicExists(String topicName)

Gets whether or not a topic with topicName exists in the Service Bus namespace.

getTopicExistsWithResponse(String topicName)

Gets whether or not a topic with topicName exists in the Service Bus namespace.

getTopicRuntimeProperties(String topicName)

Gets runtime properties about the topic.

getTopicRuntimePropertiesWithResponse(String topicName)

Gets runtime properties about the topic with its HTTP response.

getTopicWithResponse(String topicName)

Gets information about the topic along with its HTTP response.

listQueues()

Fetches all the queues in the Service Bus namespace.

listRules(String topicName, String subscriptionName)

Fetches all the rules for a topic and subscription.

listSubscriptions(String topicName)

Fetches all the subscriptions for a topic.

listTopics()

Fetches all the topics in the Service Bus namespace.

updateQueue(QueueProperties queue)

Updates a queue with the given QueueProperties. The QueueProperties must be fully populated as all of the properties are replaced. If a property is not set the service default value is used. The suggested flow is:

  1. getQueue(String queueName)
  2. Update the required elements.
  3. Pass the updated description into this method.

There are a subset of properties that can be updated. More information can be found in the links below. They are:

updateQueueWithResponse(QueueProperties queue)

Updates a queue with the given QueueProperties. The QueueProperties must be fully populated as all of the properties are replaced. If a property is not set the service default value is used. The suggested flow is:

  1. getQueue(String queueName)
  2. Update the required elements.
  3. Pass the updated description into this method.

There are a subset of properties that can be updated. More information can be found in the links below. They are:

updateRule(String topicName, String subscriptionName, RuleProperties rule)

Updates a rule with the given RuleProperties. The RuleProperties must be fully populated as all of the properties are replaced. If a property is not set the service default value is used. The suggested flow is:

  1. getRule(String topicName, String subscriptionName, String ruleName)
  2. Update the required elements.
  3. Pass the updated description into this method.
updateRuleWithResponse(String topicName, String subscriptionName, RuleProperties rule)

Updates a rule with the given RuleProperties. The RuleProperties must be fully populated as all of the properties are replaced. If a property is not set the service default value is used. The suggested flow is:

  1. getRule(String topicName, String subscriptionName, String ruleName)
  2. Update the required elements.
  3. Pass the updated description into this method.
updateSubscription(SubscriptionProperties subscription)

Updates a subscription with the given SubscriptionProperties. The SubscriptionProperties must be fully populated as all of the properties are replaced. If a property is not set the service default value is used. The suggested flow is:

  1. getSubscription(String topicName, String subscriptionName)
  2. Update the required elements.
  3. Pass the updated description into this method.

There are a subset of properties that can be updated. More information can be found in the links below. They are:

updateSubscriptionWithResponse(SubscriptionProperties subscription)

Updates a subscription with the given SubscriptionProperties. The SubscriptionProperties must be fully populated as all of the properties are replaced. If a property is not set the service default value is used. The suggested flow is:

  1. getSubscription(String topicName, String subscriptionName)
  2. Update the required elements.
  3. Pass the updated description into this method.

There are a subset of properties that can be updated. More information can be found in the links below. They are:

updateTopic(TopicProperties topic)

Updates a topic with the given TopicProperties. The TopicProperties must be fully populated as all of the properties are replaced. If a property is not set the service default value is used. The suggested flow is:

  1. getTopic(String topicName)
  2. Update the required elements.
  3. Pass the updated description into this method.

There are a subset of properties that can be updated. More information can be found in the links below. They are:

updateTopicWithResponse(TopicProperties topic)

Updates a topic with the given TopicProperties. The TopicProperties must be fully populated as all of the properties are replaced. If a property is not set the service default value is used. The suggested flow is:

  1. getTopic(String topicName)
  2. Update the required elements.
  3. Pass the updated description into this method.

There are a subset of properties that can be updated. More information can be found in the links below. They are:

Inherited Members

java.lang.Object.clone() java.lang.Object.equals(java.lang.Object) java.lang.Object.finalize() java.lang.Object.getClass() java.lang.Object.hashCode() java.lang.Object.notify() java.lang.Object.notifyAll() java.lang.Object.toString() java.lang.Object.wait() java.lang.Object.wait(long) java.lang.Object.wait(long,int)

Applies to