package
0.4.1
Repository: https://github.com/dapr/components-contrib.git
Documentation: pkg.go.dev

# README

Pub Sub

Pub Subs provide a common way to interact with different message bus implementations to achieve reliable, high-scale scenarios based on event-driven async communications, while allowing users to opt-in to advanced capabilities using defined metadata.

Currently supported pub-subs are:

  • Hazelcast
  • Redis Streams
  • NATS
  • Kafka
  • Azure Service Bus
  • RabbitMQ
  • Azure Event Hubs
  • GCP Pub/Sub
  • MQTT

Implementing a new Pub Sub

A compliant pub sub needs to implement the following interface:

type PubSub interface {
	Init(metadata Metadata) error
	Publish(req *PublishRequest) error
	Subscribe(req SubscribeRequest, handler func(msg *NewMessage) error) error
}

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package natsstreaming implements NATS Streaming pubsub component */.
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

NewCloudEventsEnvelope returns CloudEventsEnvelope from data or a new one when data content was not.

# Constants

CloudEventsSpecVersion is the specversion used by Dapr for the cloud events implementation.
ContentType is the Cloud Events HTTP content type.
DefaultCloudEventSource is the default event source.
DefaultCloudEventType is the default event type for an Dapr published event.
Drop means the message is received but should not be processed.
Retry means the message is received but could not be processed and must be retried.
Success means the message is received and processed correctly.

# Structs

AppResponse is the object describing the response from user code after a pubsub event.
CloudEventsEnvelope describes the Dapr implementation of the Cloud Events spec Spec details: https://github.com/cloudevents/spec/blob/master/spec.md.
Metadata represents a set of message-bus specific properties.
NewMessage is an event arriving from a message bus instance.
PublishRequest is the request to publish a message.
SubscribeRequest is the request to subscribe to a topic.

# Interfaces

PubSub is the interface for message buses.

# Type aliases

AppResponseStatus represents a status of a PubSub response.