Documentation ¶
Index ¶
- type Listener
- func (l *Listener) AppendFilterDefinition(definition *filterDefinition)
- func (l *Listener) Close(ctx context.Context) error
- func (l *Listener) GetActiveMessageCount(ctx context.Context, topicName, subscriptionName string) (int32, error)
- func (l *Listener) Listen(ctx context.Context, handler message.Handler, topicName string, opts ...Option) error
- func (l *Listener) SetSubscriptionName(subscriptionName string)
- func (l *Listener) Subscription() *servicebus.SubscriptionEntity
- func (l *Listener) Topic() *servicebus.TopicEntity
- type ManagementOption
- func WithConnectionString(connStr string) ManagementOption
- func WithEnvironmentName(environmentName string) ManagementOption
- func WithFilterDescriber(filterName string, filter servicebus.FilterDescriber) 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 WithSubscriptionName(name string) ManagementOption
- func WithToken(serviceBusNamespaceName string, spt *adal.ServicePrincipalToken) ManagementOption
- func WithTypeFilter(event interface{}) ManagementOption
- type Option
- type TopicListener
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 topic
func New ¶
func New(opts ...ManagementOption) (*Listener, error)
New creates a new service bus listener
func (*Listener) AppendFilterDefinition ¶
func (l *Listener) AppendFilterDefinition(definition *filterDefinition)
func (*Listener) GetActiveMessageCount ¶
func (l *Listener) GetActiveMessageCount(ctx context.Context, topicName, subscriptionName string) (int32, error)
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, topicName string, opts ...Option) error
Listen waits for a message from the Service Bus Topic subscription
func (*Listener) SetSubscriptionName ¶
func (*Listener) Subscription ¶
func (l *Listener) Subscription() *servicebus.SubscriptionEntity
Subscription returns the servicebus.SubscriptionEntity that the listener is setup with
func (*Listener) Topic ¶
func (l *Listener) Topic() *servicebus.TopicEntity
Topic returns servicebus.TopicEntity 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 WithFilterDescriber ¶
func WithFilterDescriber(filterName string, filter servicebus.FilterDescriber) ManagementOption
WithFilterDescriber configures the filters on the subscription
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 WithSubscriptionName ¶
func WithSubscriptionName(name string) ManagementOption
WithSubscriptionName configures the subscription name of the subscription to listen to
func WithToken ¶
func WithToken(serviceBusNamespaceName string, spt *adal.ServicePrincipalToken) ManagementOption
WithToken configures a listener with a AAD token
func WithTypeFilter ¶
func WithTypeFilter(event interface{}) ManagementOption
WithTypeFilter will subscribe to event of the go type provided. It uses the `type` property automatically to messages published via go-shuttle.
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