Backbone

backbone.scaladsl.Backbone
See theBackbone companion object
class Backbone(implicit val sqs: SqsAsyncClient, val sns: SnsAsyncClient, system: ActorSystem)

Subscribing to certain kinds of messages from various SNS topics and consume them via a Amazon SQS queue, and publish messages to an Amazon SNS topic.

Value parameters

sns

implicit aws sns async client

sqs

implicit aws sqs async client

system

implicit actor system

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def actorPublisher[T](settings: PublisherSettings, bufferSize: Int, overflowStrategy: OverflowStrategy)(implicit mw: MessageWriter[T]): ActorRef

An actor reference that publishes received messages of type T to an AWS SNS topic.

An actor reference that publishes received messages of type T to an AWS SNS topic.

Type parameters

T

type of messages to publish

Value parameters

bufferSize

size of the buffer

mw

typeclass instance describing how to write a single message to a String

overflowStrategy

strategy to use if the buffer is full

settings

PublisherSettings configuring Backbone

Attributes

Returns

an ActorRef that publishes received messages

def consume[T](settings: ConsumerSettings)(f: T => ProcessingResult)(implicit fo: MessageReader[T]): Future[Done]

Consume messages of type T until an optional condition in ConsumerSettings is met.

Consume messages of type T until an optional condition in ConsumerSettings is met.

Creates a queue with the name provided in settings if it does not already exist. Subscribes the queue to all provided topics and modifies the AWS Policy to allow sending messages to the queue from the topics.

Type parameters

T

type of message to consume

Value parameters

f

function which processes messages of type T and returns a ProcessingResult

fo

Format[T] typeclass instance describing how to decode SQS Message to T

settings

ConsumerSettings configuring Backbone

Attributes

Returns

a future completing when the stream quits

def consumeAsync[T](settings: ConsumerSettings)(f: T => Future[ProcessingResult])(implicit fo: MessageReader[T]): Future[Done]

Consume messages of type T until an optional condition in ConsumerSettings is met.

Consume messages of type T until an optional condition in ConsumerSettings is met.

Creates a queue with the name provided in settings if it does not already exist. Subscribes the queue to all provided topics and modifies the AWS Policy to allow sending messages to the queue from the topics.

Type parameters

T

type of message to consume

Value parameters

f

function which processes messages of type T and returns a Future[ProcessingResult]

fo

Format[T] typeclass instance describing how to decode SQS Message to T

settings

ConsumerSettings configuring Backbone

Attributes

Returns

a future completing when the stream quits

def consumeWithHeaders[T](settings: ConsumerSettings)(f: (T, MessageHeaders) => ProcessingResult)(implicit fo: MessageReader[T]): Future[Done]

Consume messages of type T including MessageHeaders until an optional condition in ConsumerSettings is met.

Consume messages of type T including MessageHeaders until an optional condition in ConsumerSettings is met.

Creates a queue with the name provided in settings if it does not already exist. Subscribes the queue to all provided topics and modifies the AWS Policy to allow sending messages to the queue from the topics.

Type parameters

T

type of message to consume

Value parameters

f

function which processes messages of type T and returns a ProcessingResult

fo

Format[T] typeclass instance describing how to decode SQS Message to T

settings

ConsumerSettings configuring Backbone

Attributes

Returns

a future completing when the stream quits

def consumeWithHeadersAsync[T](settings: ConsumerSettings)(f: (T, MessageHeaders) => Future[ProcessingResult])(implicit fo: MessageReader[T]): Future[Done]

Consume messages of type T until an optional condition in ConsumerSettings is met.

Consume messages of type T until an optional condition in ConsumerSettings is met.

Creates a queue with the name provided in settings if it does not already exist. Subscribes the queue to all provided topics and modifies the AWS Policy to allow sending messages to the queue from the topics.

Type parameters

T

type of message to consume

Value parameters

f

function which processes messages of type T and returns a Future[ProcessingResult]

fo

Format[T] typeclass instance describing how to decode SQS Message to T

settings

ConsumerSettings configuring Backbone

Attributes

Returns

a future completing when the stream quits

def publishAsync[T](message: T, settings: PublisherSettings)(implicit mw: MessageWriter[T]): Future[Done]

Publish a single message of type T to an AWS SNS topic.

Publish a single message of type T to an AWS SNS topic.

Type parameters

T

type of message to publish

Value parameters

message

the message to publish

mw

typeclass instance describing how to write the message to a String

settings

PublisherSettings configuring Backbone

Attributes

Returns

a future completing when the stream quits

def publishAsync[T](messages: List[T], settings: PublisherSettings)(implicit mw: MessageWriter[T]): Future[Done]

Publish a list of messages of type T to an AWS SNS topic.

Publish a list of messages of type T to an AWS SNS topic.

Type parameters

T

type of messages to publish

Value parameters

messages

the messages to publish

mw

typeclass instance describing how to write a single message to a String

settings

PublisherSettings configuring Backbone

Attributes

Returns

a future completing when the stream quits

def publishWithHeadersAsync[T](message: T, headers: MessageHeaders, settings: PublisherSettings)(implicit mw: MessageWriter[T]): Future[Done]

Publish a single message of type T including MessageHeaders to an AWS SNS topic.

Publish a single message of type T including MessageHeaders to an AWS SNS topic.

Type parameters

T

type of message to publish

Value parameters

message

the message to publish

mw

typeclass instance describing how to write the message to a String

settings

PublisherSettings configuring Backbone

Attributes

Returns

a future completing when the stream quits

def publisherSink[T](settings: PublisherSettings)(implicit mw: MessageWriter[T]): Sink[T, Future[Done]]

Returns a sink that publishes received messages of type T to an AWS SNS topic.

Returns a sink that publishes received messages of type T to an AWS SNS topic.

Type parameters

T

type of messages to publish

Value parameters

mw

typeclass instance describing how to write a single message to a String

settings

PublisherSettings configuring Backbone

Attributes

Returns

a Sink that publishes received messages

def publisherSinkWithHeaders[T](settings: PublisherSettings)(implicit mw: MessageWriter[T]): Sink[(T, MessageHeaders), Future[Done]]

Returns a sink that publishes received messages of type T including message headers to an AWS SNS topic.

Returns a sink that publishes received messages of type T including message headers to an AWS SNS topic.

Type parameters

T

type of messages to publish

Value parameters

mw

typeclass instance describing how to write a single message to a String

settings

PublisherSettings configuring Backbone

Attributes

Returns

a Sink that publishes received messages

Inherited methods

def createQueue(params: CreateQueueParams)(implicit ec: ExecutionContext): Future[QueueInformation]

Attributes

Inherited from:
AmazonSqsOps (hidden)
def getQueueArn(queueUrl: String)(implicit ec: ExecutionContext): Future[String]

Attributes

Inherited from:
AmazonSqsOps (hidden)
def savePolicy(queueUrl: String, policy: String)(implicit ec: ExecutionContext): Future[Unit]

Attributes

Inherited from:
AmazonSqsOps (hidden)
def subscribe(queue: QueueInformation, topicArn: String)(implicit ec: ExecutionContext): Future[Unit]

Attributes

Inherited from:
AmazonSnsOps (hidden)

Implicits

Implicits

implicit val sns: SnsAsyncClient
implicit val sqs: SqsAsyncClient