Backbone

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

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

Value parameters

sns

aws sns async client

sqs

aws sqs async client

system

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, mw: MessageWriter[T]): ActorRef

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

An actor reference that publishes received elements 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, format: MessageReader[T], f: Function[T, ProcessingResult]): CompletableFuture[Done]

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

Consume elements 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 events to consume

Value parameters

f

function which processes objects of type T and returns a ProcessingResult

format

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

settings

ConsumerSettings configuring Backbone

Attributes

Returns

a java future completing when the stream quits

def consumeAsync[T](settings: ConsumerSettings, format: MessageReader[T], f: Function[T, CompletionStage[ProcessingResult]]): CompletableFuture[Done]

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

Consume elements 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 events to consume

Value parameters

f

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

format

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

settings

ConsumerSettings configuring Backbone

Attributes

Returns

a java future completing when the stream quits

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

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

Publish a single element 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](msgs: List[T], settings: PublisherSettings, mw: MessageWriter[T]): CompletableFuture[Done]

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

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

Type parameters

T

type of messages to publish

Value parameters

msgs

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 publisherSink[T](settings: PublisherSettings, mw: MessageWriter[T]): Sink[T, CompletableFuture[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

Concrete fields

val sns: SnsAsyncClient
val sqs: SqsAsyncClient
val system: ActorSystem