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 |
| deleteQueueWithResponse(String queueName) |
Deletes a queue the matching |
| deleteRule(String topicName, String subscriptionName, String ruleName) |
Deletes a rule the matching |
| deleteRuleWithResponse(String topicName, String subscriptionName, String ruleName) |
Deletes a rule the matching |
| deleteSubscription(String topicName, String subscriptionName) |
Deletes a subscription the matching |
| deleteSubscriptionWithResponse(String topicName, String subscriptionName) |
Deletes a subscription the matching |
| deleteTopic(String topicName) |
Deletes a topic the matching |
| deleteTopicWithResponse(String topicName) |
Deletes a topic the matching |
| 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 |
| getQueueExistsWithResponse(String queueName) |
Gets whether or not a queue with |
| 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 |
| getTopicExistsWithResponse(String topicName) |
Gets whether or not a topic with |
| 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:
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:
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:
|
| 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:
|
| 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:
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:
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:
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:
There are a subset of properties that can be updated. More information can be found in the links below. They are: |