Packages

object Sqs extends Serializable

Source
Sqs.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Sqs
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. 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.

  7. 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()
  8. 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.

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  12. 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 the resources 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.

  13. 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 the resources 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.

  14. 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 the resources 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.

  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  22. def toString(): String
    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. 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 the resources 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)

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped