admin

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2022 License: MIT Imports: 11 Imported by: 12

Documentation

Overview

Package admin provides `Client`, which can create and manage Queues, Topics and Subscriptions. NOTE: For sending and receiving messages with Azure ServiceBus use the `Client` in the `github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus` package.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client allows you to administer resources in a Service Bus Namespace. For example, you can create queues, enabling capabilities like partitioning, duplicate detection, etc.. NOTE: For sending and receiving messages you'll need to use the `azservicebus.Client` type instead.

func NewClient

func NewClient(fullyQualifiedNamespace string, tokenCredential azcore.TokenCredential, options *ClientOptions) (*Client, error)

NewClient creates a Client authenticating using a TokenCredential.

Example
package main

import (
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/admin"
)

func main() {
	// NOTE: If you'd like to authenticate using a Service Bus connection string
	// look at `NewClientWithConnectionString` instead.

	credential, err := azidentity.NewDefaultAzureCredential(nil)
	exitOnError("Failed to create a DefaultAzureCredential", err)

	adminClient, err = admin.NewClient("<ex: myservicebus.servicebus.windows.net>", credential, nil)
	exitOnError("Failed to create ServiceBusClient in example", err)
}

// NOTE: these are just here to keep the examples succinct.
var adminClient *admin.Client

func exitOnError(message string, err error) {}
Output:

func NewClientFromConnectionString

func NewClientFromConnectionString(connectionString string, options *ClientOptions) (*Client, error)

NewClientFromConnectionString creates a Client authenticating using a connection string. connectionString can be a Service Bus connection string for the namespace or for an entity, which contains a SharedAccessKeyName and SharedAccessKey properties (for instance, from the Azure Portal):

Endpoint=sb://<sb>.servicebus.windows.net/;SharedAccessKeyName=<key name>;SharedAccessKey=<key value>

Or it can be a connection string with a SharedAccessSignature:

Endpoint=sb://<sb>.servicebus.windows.net;SharedAccessSignature=SharedAccessSignature sr=<sb>.servicebus.windows.net&sig=<base64-sig>&se=<expiry>&skn=<keyname>
Example
package main

import (
	"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/admin"
)

func main() {
	// NOTE: If you'd like to authenticate via Azure Active Directory look at
	// the `NewClient` function instead.

	adminClient, err = admin.NewClientFromConnectionString("<connection string>", nil)
	exitOnError("Failed to create ServiceBusClient in example", err)
}

// NOTE: these are just here to keep the examples succinct.
var adminClient *admin.Client
var err error

func exitOnError(message string, err error) {}
Output:

func (*Client) CreateQueue

func (ac *Client) CreateQueue(ctx context.Context, queueName string, options *CreateQueueOptions) (CreateQueueResponse, error)

CreateQueue creates a queue with configurable properties.

Example
package main

import (
	"context"
	"fmt"

	"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/admin"
)

func main() {
	resp, err := adminClient.CreateQueue(context.TODO(), "queue-name", nil)
	exitOnError("Failed to add queue", err)

	// some example properties
	fmt.Printf("Max message delivery count = %d\n", *resp.MaxDeliveryCount)
	fmt.Printf("Lock duration: %s\n", *resp.LockDuration)
}

// NOTE: these are just here to keep the examples succinct.
var adminClient *admin.Client

func exitOnError(message string, err error) {}
Output:

Example (Usingproperties)
package main

import (
	"context"
	"fmt"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/admin"
)

func main() {
	maxDeliveryCount := int32(10)

	resp, err := adminClient.CreateQueue(context.TODO(), "queue-name", &admin.CreateQueueOptions{
		Properties: &admin.QueueProperties{
			// some example properties
			LockDuration:     to.Ptr("PT1M"),
			MaxDeliveryCount: &maxDeliveryCount,
		},
	})
	exitOnError("Failed to create queue", err)

	// some example properties
	fmt.Printf("Max message delivery count = %d\n", *resp.MaxDeliveryCount)
	fmt.Printf("Lock duration: %s\n", *resp.LockDuration)
}

// NOTE: these are just here to keep the examples succinct.
var adminClient *admin.Client

func exitOnError(message string, err error) {}
Output:

func (*Client) CreateSubscription

func (ac *Client) CreateSubscription(ctx context.Context, topicName string, subscriptionName string, options *CreateSubscriptionOptions) (CreateSubscriptionResponse, error)

CreateSubscription creates a subscription to a topic with configurable properties

func (*Client) CreateTopic

func (ac *Client) CreateTopic(ctx context.Context, topicName string, options *CreateTopicOptions) (CreateTopicResponse, error)

CreateTopic creates a topic using defaults for all options.

func (*Client) DeleteQueue

func (ac *Client) DeleteQueue(ctx context.Context, queueName string, options *DeleteQueueOptions) (DeleteQueueResponse, error)

DeleteQueue deletes a queue.

func (*Client) DeleteSubscription

func (ac *Client) DeleteSubscription(ctx context.Context, topicName string, subscriptionName string, options *DeleteSubscriptionOptions) (DeleteSubscriptionResponse, error)

DeleteSubscription deletes a subscription.

func (*Client) DeleteTopic

func (ac *Client) DeleteTopic(ctx context.Context, topicName string, options *DeleteTopicOptions) (DeleteTopicResponse, error)

DeleteTopic deletes a topic.

func (*Client) GetNamespaceProperties

func (ac *Client) GetNamespaceProperties(ctx context.Context, options *GetNamespacePropertiesOptions) (GetNamespacePropertiesResponse, error)

GetNamespaceProperties gets the properties for the namespace, includings properties like SKU and CreatedTime.

func (*Client) GetQueue

func (ac *Client) GetQueue(ctx context.Context, queueName string, options *GetQueueOptions) (*GetQueueResponse, error)

GetQueue gets a queue by name. If the entity does not exist this function will return a nil GetQueueResponse and a nil error.

func (*Client) GetQueueRuntimeProperties

func (ac *Client) GetQueueRuntimeProperties(ctx context.Context, queueName string, options *GetQueueRuntimePropertiesOptions) (*GetQueueRuntimePropertiesResponse, error)

GetQueueRuntimeProperties gets runtime properties of a queue, like the SizeInBytes, or ActiveMessageCount. If the entity does not exist this function will return a nil GetQueueRuntimePropertiesResponse and a nil error.

func (*Client) GetSubscription

func (ac *Client) GetSubscription(ctx context.Context, topicName string, subscriptionName string, options *GetSubscriptionOptions) (*GetSubscriptionResponse, error)

GetSubscription gets a subscription by name. If the entity does not exist this function will return a nil GetSubscriptionResponse and a nil error.

func (*Client) GetSubscriptionRuntimeProperties

func (ac *Client) GetSubscriptionRuntimeProperties(ctx context.Context, topicName string, subscriptionName string, options *GetSubscriptionRuntimePropertiesOptions) (*GetSubscriptionRuntimePropertiesResponse, error)

GetSubscriptionRuntimeProperties gets runtime properties of a subscription, like the SizeInBytes, or SubscriptionCount. If the entity does not exist this function will return a nil GetSubscriptionRuntimePropertiesResponse and a nil error.

func (*Client) GetTopic

func (ac *Client) GetTopic(ctx context.Context, topicName string, options *GetTopicOptions) (*GetTopicResponse, error)

GetTopic gets a topic by name. If the entity does not exist this function will return a nil GetTopicResponse and a nil error.

func (*Client) GetTopicRuntimeProperties

func (ac *Client) GetTopicRuntimeProperties(ctx context.Context, topicName string, options *GetTopicRuntimePropertiesOptions) (*GetTopicRuntimePropertiesResponse, error)

GetTopicRuntimeProperties gets runtime properties of a topic, like the SizeInBytes, or SubscriptionCount. If the entity does not exist this function will return a nil GetTopicRuntimePropertiesResponse and a nil error.

func (*Client) ListQueues

func (ac *Client) ListQueues(options *ListQueuesOptions) *runtime.Pager[ListQueuesResponse]

ListQueues lists queues.

Example
package main

import (
	"context"
	"fmt"

	"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/admin"
)

func main() {
	queuePager := adminClient.ListQueues(nil)

	for queuePager.More() {
		page, err := queuePager.NextPage(context.TODO())

		if err != nil {
			panic(err)
		}

		for _, queue := range page.Queues {
			fmt.Printf("Queue name: %s, max size in MB: %d\n", queue.QueueName, *queue.MaxSizeInMegabytes)
		}
	}
}

// NOTE: these are just here to keep the examples succinct.
var adminClient *admin.Client
Output:

func (*Client) ListQueuesRuntimeProperties

ListQueuesRuntimeProperties lists runtime properties for queues.

Example
package main

import (
	"context"
	"fmt"

	"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/admin"
)

func main() {
	queuePager := adminClient.ListQueuesRuntimeProperties(nil)

	for queuePager.More() {
		page, err := queuePager.NextPage(context.TODO())

		if err != nil {
			panic(err)
		}

		for _, queue := range page.QueueRuntimeProperties {
			fmt.Printf("Queue name: %s, active messages: %d\n", queue.QueueName, queue.ActiveMessageCount)
		}
	}
}

// NOTE: these are just here to keep the examples succinct.
var adminClient *admin.Client
Output:

func (*Client) ListSubscriptions

func (ac *Client) ListSubscriptions(topicName string, options *ListSubscriptionsOptions) *runtime.Pager[ListSubscriptionsResponse]

ListSubscriptions lists subscriptions for a topic.

func (*Client) ListSubscriptionsRuntimeProperties

func (ac *Client) ListSubscriptionsRuntimeProperties(topicName string, options *ListSubscriptionsRuntimePropertiesOptions) *runtime.Pager[ListSubscriptionsRuntimePropertiesResponse]

ListSubscriptionsRuntimeProperties lists runtime properties for subscriptions for a topic.

func (*Client) ListTopics

func (ac *Client) ListTopics(options *ListTopicsOptions) *runtime.Pager[ListTopicsResponse]

ListTopics lists topics.

func (*Client) ListTopicsRuntimeProperties

ListTopicsRuntimeProperties lists runtime properties for topics.

func (*Client) UpdateQueue

func (ac *Client) UpdateQueue(ctx context.Context, queueName string, properties QueueProperties, options *UpdateQueueOptions) (UpdateQueueResponse, error)

UpdateQueue updates an existing queue.

func (*Client) UpdateSubscription

func (ac *Client) UpdateSubscription(ctx context.Context, topicName string, subscriptionName string, properties SubscriptionProperties, options *UpdateSubscriptionOptions) (UpdateSubscriptionResponse, error)

UpdateSubscription updates an existing subscription.

func (*Client) UpdateTopic

func (ac *Client) UpdateTopic(ctx context.Context, topicName string, properties TopicProperties, options *UpdateTopicOptions) (UpdateTopicResponse, error)

UpdateTopic updates an existing topic.

type ClientOptions

type ClientOptions struct {
	// RetryOptions controls how often operations are retried from this client.
	RetryOptions *RetryOptions
}

ClientOptions allows you to set optional configuration for `Client`.

type CreateQueueOptions

type CreateQueueOptions struct {
	// Properties for the queue.
	Properties *QueueProperties
}

CreateQueueOptions contains the optional parameters for Client.CreateQueue

type CreateQueueResponse

type CreateQueueResponse struct {
	QueueProperties
}

CreateQueueResponse contains the response fields for Client.CreateQueue

type CreateSubscriptionOptions

type CreateSubscriptionOptions struct {
	// Properties for the subscription.
	Properties *SubscriptionProperties
}

CreateSubscriptionOptions contains optional parameters for Client.CreateSubscription

type CreateSubscriptionResponse

type CreateSubscriptionResponse struct {
	SubscriptionProperties
}

CreateSubscriptionResponse contains response fields for Client.CreateSubscription

type CreateTopicOptions

type CreateTopicOptions struct {
	// Properties for the topic.
	Properties *TopicProperties
}

CreateTopicOptions contains optional parameters for Client.CreateTopic

type CreateTopicResponse

type CreateTopicResponse struct {
	TopicProperties
}

CreateTopicResponse contains response fields for Client.CreateTopic

type DeleteQueueOptions

type DeleteQueueOptions struct {
}

DeleteQueueOptions contains optional parameters for Client.DeleteQueue

type DeleteQueueResponse

type DeleteQueueResponse struct {
}

DeleteQueueResponse contains response fields for Client.DeleteQueue

type DeleteSubscriptionOptions

type DeleteSubscriptionOptions struct {
}

DeleteSubscriptionOptions contains optional parameters for Client.DeleteSubscription

type DeleteSubscriptionResponse

type DeleteSubscriptionResponse struct {
}

DeleteSubscriptionResponse contains response fields for Client.DeleteSubscription

type DeleteTopicOptions

type DeleteTopicOptions struct {
}

DeleteTopicOptions contains optional parameters for Client.DeleteTopic

type DeleteTopicResponse

type DeleteTopicResponse struct {
	// Value is the result of the request.
	Value *TopicProperties
}

DeleteTopicResponse contains the response fields for Client.DeleteTopic

type EntityStatus

type EntityStatus string

EntityStatus represents the current status of the entity.

const (
	// EntityStatusActive indicates an entity can be used for sending and receiving.
	EntityStatusActive EntityStatus = "Active"
	// EntityStatusDisabled indicates an entity cannot be used for sending or receiving.
	EntityStatusDisabled EntityStatus = "Disabled"
	// EntityStatusSendDisabled indicates that an entity cannot be used for sending.
	EntityStatusSendDisabled EntityStatus = "SendDisabled"
	// EntityStatusReceiveDisabled indicates that an entity cannot be used for receiving.
	EntityStatusReceiveDisabled EntityStatus = "ReceiveDisabled"
)

type GetNamespacePropertiesOptions

type GetNamespacePropertiesOptions struct {
}

GetNamespacePropertiesOptions contains the optional parameters of Client.GetNamespaceProperties

type GetNamespacePropertiesResponse

type GetNamespacePropertiesResponse struct {
	NamespaceProperties
}

GetNamespacePropertiesResponse contains the response fields of Client.GetNamespaceProperties method

type GetQueueOptions

type GetQueueOptions struct {
}

GetQueueOptions contains the optional parameters for Client.GetQueue

type GetQueueResponse

type GetQueueResponse struct {
	QueueProperties
}

GetQueueResponse contains the response fields for Client.GetQueue

type GetQueueRuntimePropertiesOptions

type GetQueueRuntimePropertiesOptions struct {
}

GetQueueRuntimePropertiesOptions contains optional parameters for client.GetQueueRuntimeProperties

type GetQueueRuntimePropertiesResponse

type GetQueueRuntimePropertiesResponse struct {
	QueueRuntimeProperties
}

GetQueueRuntimePropertiesResponse contains response fields for Client.GetQueueRuntimeProperties

type GetSubscriptionOptions

type GetSubscriptionOptions struct {
}

GetSubscriptionOptions contains optional parameters for Client.GetSubscription

type GetSubscriptionResponse

type GetSubscriptionResponse struct {
	SubscriptionProperties
}

GetSubscriptionResponse contains response fields for Client.GetSubscription

type GetSubscriptionRuntimePropertiesOptions

type GetSubscriptionRuntimePropertiesOptions struct {
}

GetSubscriptionRuntimePropertiesOptions contains optional parameters for Client.GetSubscriptionRuntimeProperties

type GetSubscriptionRuntimePropertiesResponse

type GetSubscriptionRuntimePropertiesResponse struct {
	SubscriptionRuntimeProperties
}

GetSubscriptionRuntimePropertiesResponse contains response fields for Client.GetSubscriptionRuntimeProperties

type GetTopicOptions

type GetTopicOptions struct {
}

GetTopicOptions contains optional parameters for Client.GetTopic

type GetTopicResponse

type GetTopicResponse struct {
	TopicProperties
}

GetTopicResponse contains response fields for Client.GetTopic

type GetTopicRuntimePropertiesOptions

type GetTopicRuntimePropertiesOptions struct {
}

GetTopicRuntimePropertiesOptions contains optional parameters for Client.GetTopicRuntimeProperties

type GetTopicRuntimePropertiesResponse

type GetTopicRuntimePropertiesResponse struct {
	// Value is the result of the request.
	TopicRuntimeProperties
}

GetTopicRuntimePropertiesResponse contains the result for Client.GetTopicRuntimeProperties

type ListQueuesOptions

type ListQueuesOptions struct {
	// MaxPageSize is the maximum size of each page of results.
	MaxPageSize int32
}

ListQueuesOptions can be used to configure the ListQueues method.

type ListQueuesResponse

type ListQueuesResponse struct {
	Queues []QueueItem
}

ListQueuesResponse contains the response fields for QueuePager.PageResponse

type ListQueuesRuntimePropertiesOptions

type ListQueuesRuntimePropertiesOptions struct {
	// MaxPageSize is the maximum size of each page of results.
	MaxPageSize int32
}

ListQueuesRuntimePropertiesOptions can be used to configure the ListQueuesRuntimeProperties method.

type ListQueuesRuntimePropertiesResponse

type ListQueuesRuntimePropertiesResponse struct {
	QueueRuntimeProperties []QueueRuntimePropertiesItem
}

ListQueuesRuntimePropertiesResponse contains the page response for QueueRuntimePropertiesPager.PageResponse

type ListSubscriptionsOptions

type ListSubscriptionsOptions struct {
	// MaxPageSize is the maximum size of each page of results.
	MaxPageSize int32
}

ListSubscriptionsOptions can be used to configure the ListSusbscriptions method.

type ListSubscriptionsResponse

type ListSubscriptionsResponse struct {
	// Value is the result of the request.
	Subscriptions []SubscriptionPropertiesItem
}

ListSubscriptionsResponse contains the response fields for SubscriptionPager.PageResponse

type ListSubscriptionsRuntimePropertiesOptions

type ListSubscriptionsRuntimePropertiesOptions struct {
	// MaxPageSize is the maximum size of each page of results.
	MaxPageSize int32
}

ListSubscriptionsRuntimePropertiesOptions can be used to configure the ListSubscriptionsRuntimeProperties method.

type ListSubscriptionsRuntimePropertiesResponse

type ListSubscriptionsRuntimePropertiesResponse struct {
	// Value is the result of the request.
	SubscriptionRuntimeProperties []SubscriptionRuntimePropertiesItem
}

ListSubscriptionsRuntimePropertiesResponse contains the response fields for SubscriptionRuntimePropertiesPager.PageResponse

type ListTopicsOptions

type ListTopicsOptions struct {
	// MaxPageSize is the maximum size of each page of results.
	MaxPageSize int32
}

ListTopicsOptions can be used to configure the ListTopics method.

type ListTopicsResponse

type ListTopicsResponse struct {
	// Topics is the result of the request.
	Topics []TopicItem
}

ListTopicsResponse contains response fields for the Client.PageResponse method

type ListTopicsRuntimePropertiesOptions

type ListTopicsRuntimePropertiesOptions struct {
	// MaxPageSize is the maximum size of each page of results.
	MaxPageSize int32
}

ListTopicsRuntimePropertiesOptions can be used to configure the ListTopicsRuntimeProperties method.

type ListTopicsRuntimePropertiesResponse

type ListTopicsRuntimePropertiesResponse struct {
	// TopicRuntimeProperties is the result of the request.
	TopicRuntimeProperties []TopicRuntimePropertiesItem
}

ListTopicsRuntimePropertiesResponse contains response fields for TopicRuntimePropertiesPager.PageResponse

type NamespaceProperties

type NamespaceProperties struct {
	CreatedTime  time.Time
	ModifiedTime time.Time

	SKU            string
	MessagingUnits *int64
	Name           string
}

NamespaceProperties are the properties associated with a given namespace

type QueueItem

type QueueItem struct {
	QueueName string
	QueueProperties
}

QueueItem contains the data from the Client.ListQueues pager

type QueueProperties

type QueueProperties struct {
	// LockDuration is the duration a message is locked when using the PeekLock receive mode.
	// Default is 1 minute.
	LockDuration *string

	// MaxSizeInMegabytes - The maximum size of the queue in megabytes, which is the size of memory
	// allocated for the queue.
	// Default is 1024.
	MaxSizeInMegabytes *int32

	// RequiresDuplicateDetection indicates if this queue requires duplicate detection.
	RequiresDuplicateDetection *bool

	// RequiresSession indicates whether the queue supports the concept of sessions.
	// Sessionful-messages follow FIFO ordering.
	// Default is false.
	RequiresSession *bool

	// DefaultMessageTimeToLive is the duration after which the message expires, starting from when
	// the message is sent to Service Bus. This is the default value used when TimeToLive is not
	// set on a message itself.
	DefaultMessageTimeToLive *string

	// DeadLetteringOnMessageExpiration indicates whether this queue has dead letter
	// support when a message expires.
	DeadLetteringOnMessageExpiration *bool

	// DuplicateDetectionHistoryTimeWindow is the duration of duplicate detection history.
	// Default value is 10 minutes.
	DuplicateDetectionHistoryTimeWindow *string

	// MaxDeliveryCount is the maximum amount of times a message can be delivered before it is automatically
	// sent to the dead letter queue.
	// Default value is 10.
	MaxDeliveryCount *int32

	// EnableBatchedOperations indicates whether server-side batched operations are enabled.
	EnableBatchedOperations *bool

	// Status is the current status of the queue.
	Status *EntityStatus

	// AutoDeleteOnIdle is the idle interval after which the queue is automatically deleted.
	AutoDeleteOnIdle *string

	// EnablePartitioning indicates whether the queue is to be partitioned across multiple message brokers.
	EnablePartitioning *bool

	// ForwardTo is the name of the recipient entity to which all the messages sent to the queue
	// are forwarded to.
	ForwardTo *string

	// ForwardDeadLetteredMessagesTo is the absolute URI of the entity to forward dead letter messages
	ForwardDeadLetteredMessagesTo *string

	// UserMetadata is custom metadata that user can associate with the queue.
	UserMetadata *string
}

QueueProperties represents the static properties of the queue.

type QueueRuntimeProperties

type QueueRuntimeProperties struct {
	// SizeInBytes - The size of the queue, in bytes.
	SizeInBytes int64

	// CreatedAt is when the entity was created.
	CreatedAt time.Time

	// UpdatedAt is when the entity was last updated.
	UpdatedAt time.Time

	// AccessedAt is when the entity was last updated.
	AccessedAt time.Time

	// TotalMessageCount is the number of messages in the queue.
	TotalMessageCount int64

	// ActiveMessageCount is the number of active messages in the entity.
	ActiveMessageCount int32

	// DeadLetterMessageCount is the number of dead-lettered messages in the entity.
	DeadLetterMessageCount int32

	// ScheduledMessageCount is the number of messages that are scheduled to be enqueued.
	ScheduledMessageCount int32

	// TransferDeadLetterMessageCount is the number of messages transfer-messages which are dead-lettered
	// into transfer-dead-letter subqueue.
	TransferDeadLetterMessageCount int32

	// TransferMessageCount is the number of messages which are yet to be transferred/forwarded to destination entity.
	TransferMessageCount int32
}

QueueRuntimeProperties represent dynamic properties of a queue, such as the ActiveMessageCount.

type QueueRuntimePropertiesItem

type QueueRuntimePropertiesItem struct {
	QueueName string
	QueueRuntimeProperties
}

QueueRuntimePropertiesItem contains a single item in the page response for QueueRuntimePropertiesPager.PageResponse

type RetryOptions added in v0.3.4

type RetryOptions = utils.RetryOptions

RetryOptions represent the options for retries.

type SubscriptionProperties

type SubscriptionProperties struct {
	// LockDuration is the duration a message is locked when using the PeekLock receive mode.
	// Default is 1 minute.
	LockDuration *string

	// RequiresSession indicates whether the subscription supports the concept of sessions.
	// Sessionful-messages follow FIFO ordering.
	// Default is false.
	RequiresSession *bool

	// DefaultMessageTimeToLive is the duration after which the message expires, starting from when
	// the message is sent to Service Bus. This is the default value used when TimeToLive is not
	// set on a message itself.
	DefaultMessageTimeToLive *string

	// DeadLetteringOnMessageExpiration indicates whether this subscription has dead letter
	// support when a message expires.
	DeadLetteringOnMessageExpiration *bool

	// EnableDeadLetteringOnFilterEvaluationExceptions indicates whether messages need to be
	// forwarded to dead-letter sub queue when subscription rule evaluation fails.
	EnableDeadLetteringOnFilterEvaluationExceptions *bool

	// MaxDeliveryCount is the maximum amount of times a message can be delivered before it is automatically
	// sent to the dead letter queue.
	// Default value is 10.
	MaxDeliveryCount *int32

	// Status is the current status of the subscription.
	Status *EntityStatus

	// AutoDeleteOnIdle is the idle interval after which the subscription is automatically deleted.
	AutoDeleteOnIdle *string

	// ForwardTo is the name of the recipient entity to which all the messages sent to the topic
	// are forwarded to.
	ForwardTo *string

	// ForwardDeadLetteredMessagesTo is the absolute URI of the entity to forward dead letter messages
	ForwardDeadLetteredMessagesTo *string

	// EnableBatchedOperations indicates whether server-side batched operations are enabled.
	EnableBatchedOperations *bool

	// UserMetadata is custom metadata that user can associate with the subscription.
	UserMetadata *string
}

SubscriptionProperties represents the static properties of the subscription.

type SubscriptionPropertiesItem

type SubscriptionPropertiesItem struct {
	SubscriptionProperties

	TopicName        string
	SubscriptionName string
}

SubscriptionPropertiesItem contains a single item for SubscriptionPager.PageResponse

type SubscriptionRuntimeProperties

type SubscriptionRuntimeProperties struct {
	// TotalMessageCount is the number of messages in the subscription.
	TotalMessageCount int64

	// ActiveMessageCount is the number of active messages in the entity.
	ActiveMessageCount int32

	// DeadLetterMessageCount is the number of dead-lettered messages in the entity.
	DeadLetterMessageCount int32

	// TransferMessageCount is the number of messages which are yet to be transferred/forwarded to destination entity.
	TransferMessageCount int32

	// TransferDeadLetterMessageCount is the number of messages transfer-messages which are dead-lettered
	// into transfer-dead-letter subqueue.
	TransferDeadLetterMessageCount int32

	// AccessedAt is when the entity was last updated.
	AccessedAt time.Time

	// CreatedAt is when the entity was created.
	CreatedAt time.Time

	// UpdatedAt is when the entity was last updated.
	UpdatedAt time.Time
}

SubscriptionRuntimeProperties represent dynamic properties of a subscription, such as the ActiveMessageCount.

type SubscriptionRuntimePropertiesItem

type SubscriptionRuntimePropertiesItem struct {
	SubscriptionRuntimeProperties

	TopicName        string
	SubscriptionName string
}

SubscriptionRuntimePropertiesItem contains the data from a SubscriptionRuntimePropertiesPager.PageResponse method

type TopicItem

type TopicItem struct {
	TopicProperties

	TopicName string
}

TopicItem is the data returned by the Client.ListTopics pager

type TopicProperties

type TopicProperties struct {
	// MaxSizeInMegabytes - The maximum size of the topic in megabytes, which is the size of memory
	// allocated for the topic.
	// Default is 1024.
	MaxSizeInMegabytes *int32

	// RequiresDuplicateDetection indicates if this topic requires duplicate detection.
	RequiresDuplicateDetection *bool

	// DefaultMessageTimeToLive is the duration after which the message expires, starting from when
	// the message is sent to Service Bus. This is the default value used when TimeToLive is not
	// set on a message itself.
	DefaultMessageTimeToLive *string

	// DuplicateDetectionHistoryTimeWindow is the duration of duplicate detection history.
	// Default value is 10 minutes.
	DuplicateDetectionHistoryTimeWindow *string

	// EnableBatchedOperations indicates whether server-side batched operations are enabled.
	EnableBatchedOperations *bool

	// Status is the current status of the topic.
	Status *EntityStatus

	// AutoDeleteOnIdle is the idle interval after which the topic is automatically deleted.
	AutoDeleteOnIdle *string

	// EnablePartitioning indicates whether the topic is to be partitioned across multiple message brokers.
	EnablePartitioning *bool

	// SupportOrdering defines whether ordering needs to be maintained. If true, messages
	// sent to topic will be forwarded to the subscription, in order.
	SupportOrdering *bool

	// UserMetadata is custom metadata that user can associate with the topic.
	UserMetadata *string
}

TopicProperties represents the static properties of the topic.

type TopicRuntimeProperties

type TopicRuntimeProperties struct {
	// SizeInBytes - The size of the topic, in bytes.
	SizeInBytes int64

	// CreatedAt is when the entity was created.
	CreatedAt time.Time

	// UpdatedAt is when the entity was last updated.
	UpdatedAt time.Time

	// AccessedAt is when the entity was last updated.
	AccessedAt time.Time

	// SubscriptionCount is the number of subscriptions to the topic.
	SubscriptionCount int32

	// ScheduledMessageCount is the number of messages that are scheduled to be entopicd.
	ScheduledMessageCount int32
}

TopicRuntimeProperties represent dynamic properties of a topic, such as the ActiveMessageCount.

type TopicRuntimePropertiesItem

type TopicRuntimePropertiesItem struct {
	TopicRuntimeProperties

	TopicName string
}

TopicRuntimePropertiesItem contains fields for the Client.ListTopicsRuntimeProperties method

type UpdateQueueOptions

type UpdateQueueOptions struct {
}

UpdateQueueOptions contains optional parameters for Client.UpdateQueue

type UpdateQueueResponse

type UpdateQueueResponse struct {
	QueueProperties
}

UpdateQueueResponse contains the response fields for Client.UpdateQueue

type UpdateSubscriptionOptions

type UpdateSubscriptionOptions struct {
}

UpdateSubscriptionOptions contains the optional parameters for Client.UpdateSubscription

type UpdateSubscriptionResponse

type UpdateSubscriptionResponse struct {
	SubscriptionProperties
}

UpdateSubscriptionResponse contains the response fields for Client.UpdateSubscription

type UpdateTopicOptions

type UpdateTopicOptions struct {
}

UpdateTopicOptions contains optional parameters for Client.UpdateTopic

type UpdateTopicResponse

type UpdateTopicResponse struct {
	TopicProperties
}

UpdateTopicResponse contains response fields for Client.UpdateTopic

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL