eventhubs

package
v1.12.9 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxBulkSubCount                 = 100
	DefaultMaxBulkSubAwaitDurationMs       = 10000
	DefaultCheckpointFrequencyPerPartition = 1
)

Variables

This section is empty.

Functions

func NewBindingsReadResponseFromEventData added in v1.12.0

func NewBindingsReadResponseFromEventData(e *azeventhubs.ReceivedEventData, topic string, getAllProperties bool) (*bindings.ReadResponse, error)

Returns bindings read response message from azure eventhub message

func NewBulkMessageEntryFromEventData added in v1.12.0

func NewBulkMessageEntryFromEventData(e *azeventhubs.ReceivedEventData, topic string, getAllProperties bool) (pubsub.BulkMessageEntry, error)

Returns a new bulk pubsub message entry from azure eventhub message

func NewPubsubMessageFromEventData added in v1.12.0

func NewPubsubMessageFromEventData(e *azeventhubs.ReceivedEventData, topic string, getAllProperties bool) (*pubsub.NewMessage, error)

Returns a new pubsub message from azure eventhub message

Types

type AzureEventHubs

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

AzureEventHubs allows sending/receiving Azure Event Hubs events. This is an abstract class used by both the pubsub and binding components.

func NewAzureEventHubs

func NewAzureEventHubs(logger logger.Logger, isBinding bool) *AzureEventHubs

NewAzureEventHubs returns a new Azure Event hubs instance.

func (*AzureEventHubs) Close

func (aeh *AzureEventHubs) Close() (err error)

func (*AzureEventHubs) EventHubName

func (aeh *AzureEventHubs) EventHubName() string

EventHubName returns the parsed eventHub property from the metadata. It's used by the binding only.

func (*AzureEventHubs) GetBindingsHandlerFunc added in v1.12.0

func (aeh *AzureEventHubs) GetBindingsHandlerFunc(topic string, getAllProperties bool, handler bindings.Handler) HandlerFn

GetBindingsHandlerFunc returns the handler function for bindings messages

func (*AzureEventHubs) GetBulkPubSubHandlerFunc added in v1.12.0

func (aeh *AzureEventHubs) GetBulkPubSubHandlerFunc(topic string, getAllProperties bool, handler pubsub.BulkHandler) HandlerFn

GetPubSubHandlerFunc returns the handler function for bulk pubsub messages.

func (*AzureEventHubs) GetPubSubHandlerFunc added in v1.12.0

func (aeh *AzureEventHubs) GetPubSubHandlerFunc(topic string, getAllProperties bool, handler pubsub.Handler) HandlerFn

GetPubSubHandlerFunc returns the handler function for pubsub messages

func (*AzureEventHubs) Init

func (aeh *AzureEventHubs) Init(metadata map[string]string) error

Init connects to Azure Event Hubs.

func (*AzureEventHubs) Publish

func (aeh *AzureEventHubs) Publish(ctx context.Context, topic string, messages []*azeventhubs.EventData, batchOpts *azeventhubs.EventDataBatchOptions) error

Publish a batch of messages.

func (*AzureEventHubs) Subscribe

func (aeh *AzureEventHubs) Subscribe(subscribeCtx context.Context, config SubscribeConfig) error

Subscribe receives data from Azure Event Hubs in background.

type AzureEventHubsMetadata added in v1.11.0

type AzureEventHubsMetadata struct {
	ConnectionString        string `json:"connectionString" mapstructure:"connectionString"`
	EventHubNamespace       string `json:"eventHubNamespace" mapstructure:"eventHubNamespace"`
	ConsumerID              string `json:"consumerID" mapstructure:"consumerID"`
	StorageConnectionString string `json:"storageConnectionString" mapstructure:"storageConnectionString"`
	StorageAccountName      string `json:"storageAccountName" mapstructure:"storageAccountName"`
	StorageAccountKey       string `json:"storageAccountKey" mapstructure:"storageAccountKey"`
	StorageContainerName    string `json:"storageContainerName" mapstructure:"storageContainerName"`
	EnableEntityManagement  bool   `json:"enableEntityManagement,string" mapstructure:"enableEntityManagement"`
	MessageRetentionInDays  int32  `json:"messageRetentionInDays,string" mapstructure:"messageRetentionInDays"`
	PartitionCount          int32  `json:"partitionCount,string" mapstructure:"partitionCount"`
	SubscriptionID          string `json:"subscriptionID" mapstructure:"subscriptionID"`
	ResourceGroupName       string `json:"resourceGroupName" mapstructure:"resourceGroupName"`

	// Binding only
	EventHub      string `json:"eventHub" mapstructure:"eventHub" mdonly:"bindings"`
	ConsumerGroup string `json:"consumerGroup" mapstructure:"consumerGroup" mdonly:"bindings"` // Alias for ConsumerID
	// contains filtered or unexported fields
}

type HandlerFn added in v1.12.0

type HandlerResponseItem added in v1.12.0

type HandlerResponseItem struct {
	EntryID string
	Error   error
}

HandlerResponseItem represents a response from the handler for each message.

type SubscribeConfig added in v1.12.0

type SubscribeConfig struct {
	Topic                           string
	MaxBulkSubCount                 int
	MaxBulkSubAwaitDurationMs       int
	CheckPointFrequencyPerPartition int
	Handler                         HandlerFn
}

type SubscribeHandler

type SubscribeHandler func(ctx context.Context, data []byte, metadata map[string]string) error

Type for the handler for messages coming in from the subscriptions.

Jump to

Keyboard shortcuts

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