object Sqs extends Serializable
- Source
- Sqs.scala
- Alphabetic
- By Inheritance
- Sqs
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def create(credentialsProvider: AwsCredentialsProvider, region: Region, endpoint: Option[String] = None, httpClient: Option[SdkAsyncHttpClient] = None): Resource[Task, Sqs]
Creates a Resource that using passed-by-parameter AWS configurations, it encodes the acquisition and release of the resources needed to instantiate the Sqs.
Creates a Resource that using passed-by-parameter AWS configurations, it encodes the acquisition and release of the resources needed to instantiate the Sqs.
Example
import cats.effect.Resource import monix.eval.Task import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider import software.amazon.awssdk.regions.Region val defaultCredentials = DefaultCredentialsProvider.create() val sqsResource: Resource[Task, Sqs] = Sqs.create(defaultCredentials, Region.AWS_GLOBAL)
- credentialsProvider
strategy for loading credentials and authenticate to AWS Sqs
- region
an Amazon Web Services region that hosts a set of Amazon services.
- endpoint
the endpoint with which the SDK should communicate.
- httpClient
sets the SdkAsyncHttpClient that the SDK service client will use to make HTTP calls.
- returns
a Resource of Task that acquires and releases Sqs connection.
- def createUnsafe(credentialsProvider: AwsCredentialsProvider, region: Region, endpoint: Option[String] = None, httpClient: Option[SdkAsyncHttpClient] = None): Sqs
Creates a new Sqs instance out of the the passed AWS configurations.
Creates a new Sqs instance out of the the passed AWS configurations.
It provides a fast forward access to the Sqs instance. Thus, it is the user's responsibility of the user to do a proper resource usage and so, closing the connection.
Example
import monix.execution.Scheduler.Implicits.global import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider import software.amazon.awssdk.regions.Region import monix.eval.Task val defaultCred = DefaultCredentialsProvider.create() val sqs: Sqs = Sqs.createUnsafe(defaultCred, Region.AWS_GLOBAL) // do your stuff here sqs.close.runToFuture
- credentialsProvider
Strategy for loading credentials and authenticate to AWS S3
- region
An Amazon Web Services region that hosts a set of Amazon services.
- endpoint
The endpoint with which the SDK should communicate.
- httpClient
Sets the SdkAsyncHttpClient that the SDK service client will use to make HTTP calls.
- returns
a Resource of Task that allocates and releases Sqs.
- Annotations
- @UnsafeBecauseImpure()
- def createUnsafe(implicit sqsAsyncClient: SqsAsyncClient): Sqs
Creates a instance of Sqs out of a SqsAsyncClient which provides a fast forward access to the Sqs that avoids dealing with a proper resource and usage.
Creates a instance of Sqs out of a SqsAsyncClient which provides a fast forward access to the Sqs that avoids dealing with a proper resource and usage.
Unsafe because the state of the passed SqsAsyncClient is not guaranteed, it can either be malformed or closed, which would result in underlying failures.
Example
import java.time.Duration import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider import software.amazon.awssdk.regions.Region.AWS_GLOBAL import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient import software.amazon.awssdk.services.sqs.SqsAsyncClient // the exceptions related with concurrency or timeouts from any of the requests // might be solved by raising the `maxConcurrency`, `maxPendingConnectionAcquire` or // `connectionAcquisitionTimeout` from the underlying netty http async client. // see below an example on how to increase such values. val httpClient = NettyNioAsyncHttpClient.builder() .maxConcurrency(500) .maxPendingConnectionAcquires(50000) .connectionAcquisitionTimeout(Duration.ofSeconds(60)) .readTimeout(Duration.ofSeconds(60)) .build() val sqsAsyncClient: SqsAsyncClient = SqsAsyncClient .builder() .httpClient(httpClient) .credentialsProvider(DefaultCredentialsProvider.create()) .region(AWS_GLOBAL) .build() val sqs: Sqs = Sqs.createUnsafe(sqsAsyncClient)
- sqsAsyncClient
an instance of a SqsAsyncClient.
- returns
an instance of Sqs
- Annotations
- @UnsafeBecauseImpure()
- See also
Sqs.fromConfig and Sqs.create for a pure implementation. They both will make sure that the s3 connection is created with the required resources and guarantee that the client was not previously closed.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromConfig(monixAwsConf: Task[MonixAwsConf]): Resource[Task, Sqs]
Provides a resource that uses the values from the config file to acquire and release a Sqs instance.
Provides a resource that uses the values from the config file to acquire and release a Sqs instance.
The config will come from MonixAwsConf which it is actually obtained from the
application.conf
file present under theresources
folder.Example
import monix.connect.aws.auth.MonixAwsConf import monix.eval.Task import monix.connect.sqs.Sqs val awsConf: Task[MonixAwsConf] = MonixAwsConf.load() Sqs.fromConfig(awsConf).use { sqs => //business logic here Task.unit }
- monixAwsConf
a task containing the monix aws config read from config file.
- returns
a Resource of Task that acquires and releases a Sqs connection.
- def fromConfig(monixAwsConf: MonixAwsConf): Resource[Task, Sqs]
Provides a resource that uses the values from the config file to acquire and release a Sqs instance.
Provides a resource that uses the values from the config file to acquire and release a Sqs instance.
The config will come from MonixAwsConf which it is actually obtained from the
application.conf
file present under theresources
folder.Example
import monix.connect.aws.auth.MonixAwsConf import monix.connect.sqs.Sqs import monix.eval.Task import software.amazon.awssdk.regions.Region MonixAwsConf.load().flatMap{ awsConf => // you can update your config from code too val updatedAwsConf = awsConf.copy(region = Region.AP_SOUTH_1) Sqs.fromConfig(updatedAwsConf).use { sqs => //business logic here Task.unit } }
- monixAwsConf
the monix aws config read from config file.
- returns
a Resource of Task that acquires and releases a Sqs connection.
- def fromConfig(namingConvention: NamingConvention = KebabCase): Resource[Task, Sqs]
Provides a resource that uses the values from the config file to acquire and release a Sqs instance.
Provides a resource that uses the values from the config file to acquire and release a Sqs instance.
It does not requires any input parameter as it expect the aws config to be set from
application.conf
, which has to be placed under theresources
folder and will overwrite the defaults values from:https://github.com/monix/monix-connect/blob/master/aws-auth/src/main/resources/reference.conf
.Example
import monix.connect.aws.auth.MonixAwsConf import monix.connect.sqs.Sqs import monix.eval.Task Sqs.fromConfig.use { sqs => //business logic here Task.unit }
- returns
a Resource of Task that acquires and releases a Sqs connection.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def fromConfig: Resource[Task, Sqs]
Provides a resource that uses the values from the config file to acquire and release a Sqs instance.
Provides a resource that uses the values from the config file to acquire and release a Sqs instance.
It does not requires any input parameter as it expect the aws config to be set from
application.conf
, which has to be placed under theresources
folder and will overwrite the defaults values from:https://github.com/monix/monix-connect/blob/master/aws-auth/src/main/resources/reference.conf
.Example
import monix.connect.aws.auth.MonixAwsConf import monix.connect.sqs.Sqs import monix.eval.Task Sqs.fromConfig.use { sqs => //business logic here Task.unit }
- returns
a Resource of Task that acquires and releases a Sqs connection.
- Annotations
- @deprecated
- Deprecated
(Since version 0.6.1) Use
fromConfig(namingConvention)