Documentation ¶
Index ¶
- type Listener
- func (l *Listener) Close(ctx context.Context) error
- func (l *Listener) GetActiveMessageCount(ctx context.Context, queueName string) (int32, error)
- func (l *Listener) Listen(ctx context.Context, handler message.Handler, queueName string, ...) error
- func (l *Listener) Queue() *servicebus.QueueEntity
- func (l *Listener) QueueListener() *servicebus.Queue
- type ManagementOption
- func WithConnectionString(connStr string) ManagementOption
- func WithEnvironmentName(environmentName string) ManagementOption
- func WithLockDuration(lock time.Duration) ManagementOption
- func WithManagedIdentityClientID(serviceBusNamespaceName, managedIdentityClientID string) ManagementOption
- func WithManagedIdentityResourceID(serviceBusNamespaceName, managedIdentityResourceID string) ManagementOption
- func WithMaxDeliveryCount(maxDelivery int32) ManagementOption
- func WithSubscriptionDetails(lock time.Duration, maxDelivery int32) ManagementOption
- func WithToken(serviceBusNamespaceName string, spt *adal.ServicePrincipalToken) ManagementOption
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Listener ¶
type Listener struct { common.ListenerSettings // contains filtered or unexported fields }
Listener is a struct to contain service bus entities relevant to subscribing to a publisher queue
func New ¶
func New(opts ...listeneropts.ManagementOption) (*Listener, error)
New creates a new service bus listener
func (*Listener) GetActiveMessageCount ¶
GetActiveMessageCount gets the active message count of a topic subscription WARNING: GetActiveMessageCount is 10 times expensive than a call to receive a message
func (*Listener) Listen ¶
func (l *Listener) Listen(ctx context.Context, handler message.Handler, queueName string, opts ...listeneropts.Option) error
Listen waits for a message from the Service Bus Topic subscription
func (*Listener) Queue ¶
func (l *Listener) Queue() *servicebus.QueueEntity
Queue returns servicebus.QueueEntity that the listener is setup with
func (*Listener) QueueListener ¶
func (l *Listener) QueueListener() *servicebus.Queue
QueueListener returns the servicebus.Queue that the listener is setup with
type ManagementOption ¶
type ManagementOption = listeneropts.ManagementOption
func WithConnectionString ¶
func WithConnectionString(connStr string) ManagementOption
WithConnectionString configures a listener with the information provided in a Service Bus connection string
func WithEnvironmentName ¶
func WithEnvironmentName(environmentName string) ManagementOption
WithEnvironmentName configures the azure environment used to connect to Servicebus. The environment value used is then provided by Azure/go-autorest. ref: https://github.com/Azure/go-autorest/blob/c7f947c0610de1bc279f76e6d453353f95cd1bfa/autorest/azure/environments.go#L34
func WithLockDuration ¶
func WithLockDuration(lock time.Duration) ManagementOption
WithLockDuration allows listeners to control LockDuration. Passing zeros leaves it up to Service bus defaults
func WithManagedIdentityClientID ¶
func WithManagedIdentityClientID(serviceBusNamespaceName, managedIdentityClientID string) ManagementOption
WithManagedIdentityClientID configures a listener with the attached managed identity and the Service bus resource name
func WithManagedIdentityResourceID ¶
func WithManagedIdentityResourceID(serviceBusNamespaceName, managedIdentityResourceID string) ManagementOption
WithManagedIdentityResourceID configures a listener with the attached managed identity and the Service bus resource name
func WithMaxDeliveryCount ¶
func WithMaxDeliveryCount(maxDelivery int32) ManagementOption
WithQueueMaxDeliveryCount allows listeners to control MaxDeliveryCount. Passing zeros leaves it up to Service bus defaults
func WithSubscriptionDetails ¶
func WithSubscriptionDetails(lock time.Duration, maxDelivery int32) ManagementOption
WithDetails allows listeners to control Queue details for longer lived operations. If you using RetryLater you probably want this. Passing zeros leaves it up to Service bus defaults
func WithToken ¶
func WithToken(serviceBusNamespaceName string, spt *adal.ServicePrincipalToken) ManagementOption
WithToken configures a listener with a AAD token
type Option ¶
type Option = listeneropts.Option
func WithMaxConcurrency ¶
func WithPrefetchCount ¶
WithPrefetchCount the receiver to quietly acquires more messages, up to the PrefetchCount limit. A single Receive call to the ServiceBus api therefore acquires several messages for immediate consumption that is returned as soon as available. Please be aware of the consequences : https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-prefetch#if-it-is-faster-why-is-prefetch-not-the-default-option