ServiceBusAdministrationClient Class

Definition

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

A synchronous client for managing a Service Bus namespace.

Create a queue

QueueProperties queue = client.createQueue("my-new-queue");
 System.out.printf("Queue created. Name: %s. Lock Duration: %s.%n",
     queue.getName(), queue.getLockDuration());

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.
 SubscriptionProperties subscription = client.getSubscription("my-topic", "my-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.
 SubscriptionProperties updated = client.updateSubscription(subscription);

 System.out.printf("Subscription updated. Name: %s. Delivery count: %s.%n",
     updated.getSubscriptionName(), updated.getMaxDeliveryCount());

List all queues

client.listQueues().forEach(queue -> {
     System.out.printf("Queue [%s]. Lock Duration: %s.%n",
         queue.getName(), queue.getLockDuration());
 });
public final class ServiceBusAdministrationClient

Methods

createQueue(String queueName)

Creates a queue with the given name.

createQueue(String queueName, CreateQueueOptions queueOptions)

Creates a queue with the CreateQueueOptions.

createQueueWithResponse(String queueName, CreateQueueOptions queueOptions, Context context)

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 ruleName, String subscriptionName, CreateRuleOptions ruleOptions)

Creates a rule with the CreateRuleOptions.

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

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 SubscriptionProperties.

createSubscriptionWithResponse(String topicName, String subscriptionName, CreateSubscriptionOptions subscriptionOptions, Context context)

Creates a queue and returns the created queue 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, Context context)

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, Context context)

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, Context context)

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

deleteSubscription(String topicName, String subscriptionName)

Deletes a subscription matching the subscriptionName in topic topicName.

deleteSubscriptionWithResponse(String topicName, String subscriptionName, Context context)

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

deleteTopic(String topicName)

Deletes a topic the matching topicName.

deleteTopicWithResponse(String topicName, Context context)

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

getNamespaceProperties()

Gets information about the Service Bus namespace.

getNamespacePropertiesWithResponse(Context context)

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, Context context)

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, Context context)

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

getQueueWithResponse(String queueName, Context context)

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, Context context)

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, Context context)

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, Context context)

Gets runtime properties about the subscription.

getSubscriptionWithResponse(String topicName, String subscriptionName, Context context)

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, Context context)

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, Context context)

Gets runtime properties about the topic with its HTTP response.

getTopicWithResponse(String topicName, Context context)

Gets information about the topic along with its HTTP response.

listQueues()

Fetches all the queues in the Service Bus namespace.

listQueues(Context context)

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.

listSubscriptions(String topicName, Context context)

Fetches all the subscriptions for a topic.

listTopics()

Fetches all the topics in the Service Bus namespace.

listTopics(Context context)

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, Context context)

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, Context context)

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, Context context)

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, Context context)

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