Class SQSConnectionFactory

  • All Implemented Interfaces:
    javax.jms.ConnectionFactory, javax.jms.QueueConnectionFactory

    public class SQSConnectionFactory
    extends Object
    implements javax.jms.ConnectionFactory, javax.jms.QueueConnectionFactory
    A ConnectionFactory object encapsulates a set of connection configuration parameters for SqsClient as well as setting numberOfMessagesToPrefetch.

    The numberOfMessagesToPrefetch parameter is used to size of the prefetched messages, which can be tuned based on the application workload. It helps in returning messages from internal buffers(if there is any) instead of waiting for the SQS receiveMessage call to return.

    If more physical connections than the default maximum value (that is 50 as of today) are needed on the connection pool, ClientOverrideConfiguration needs to be configured.

    None of the createConnection methods set-up the physical connection to SQS, so validity of credentials are not checked with those methods.

    • Constructor Detail

      • SQSConnectionFactory

        public SQSConnectionFactory​(ProviderConfiguration providerConfiguration,
                                    software.amazon.awssdk.services.sqs.SqsClient client)
      • SQSConnectionFactory

        public SQSConnectionFactory​(ProviderConfiguration providerConfiguration,
                                    software.amazon.awssdk.services.sqs.SqsClientBuilder clientBuilder)
    • Method Detail

      • createConnection

        public SQSConnection createConnection()
                                       throws javax.jms.JMSException
        Specified by:
        createConnection in interface javax.jms.ConnectionFactory
        Throws:
        javax.jms.JMSException
      • createConnection

        public SQSConnection createConnection​(String awsAccessKeyId,
                                              String awsSecretKey)
                                       throws javax.jms.JMSException
        Specified by:
        createConnection in interface javax.jms.ConnectionFactory
        Throws:
        javax.jms.JMSException
      • createConnection

        public SQSConnection createConnection​(software.amazon.awssdk.auth.credentials.AwsCredentials awsCredentials)
                                       throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • createConnection

        public SQSConnection createConnection​(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider awsCredentialsProvider)
                                       throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • createQueueConnection

        public javax.jms.QueueConnection createQueueConnection()
                                                        throws javax.jms.JMSException
        Specified by:
        createQueueConnection in interface javax.jms.QueueConnectionFactory
        Throws:
        javax.jms.JMSException
      • createQueueConnection

        public javax.jms.QueueConnection createQueueConnection​(String userName,
                                                               String password)
                                                        throws javax.jms.JMSException
        Specified by:
        createQueueConnection in interface javax.jms.QueueConnectionFactory
        Throws:
        javax.jms.JMSException