Package com.amazon.sqs.javamessaging
Class SQSConnectionFactory
- java.lang.Object
-
- com.amazon.sqs.javamessaging.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 forSqsClient
as well as settingnumberOfMessagesToPrefetch
.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 SQSreceiveMessage
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 Summary
Constructors Constructor Description SQSConnectionFactory(ProviderConfiguration providerConfiguration)
SQSConnectionFactory(ProviderConfiguration providerConfiguration, software.amazon.awssdk.services.sqs.SqsClient client)
SQSConnectionFactory(ProviderConfiguration providerConfiguration, software.amazon.awssdk.services.sqs.SqsClientBuilder clientBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SQSConnection
createConnection()
SQSConnection
createConnection(String awsAccessKeyId, String awsSecretKey)
SQSConnection
createConnection(software.amazon.awssdk.auth.credentials.AwsCredentials awsCredentials)
SQSConnection
createConnection(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider awsCredentialsProvider)
javax.jms.QueueConnection
createQueueConnection()
javax.jms.QueueConnection
createQueueConnection(String userName, String password)
-
-
-
Constructor Detail
-
SQSConnectionFactory
public SQSConnectionFactory(ProviderConfiguration providerConfiguration)
-
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 interfacejavax.jms.ConnectionFactory
- Throws:
javax.jms.JMSException
-
createConnection
public SQSConnection createConnection(String awsAccessKeyId, String awsSecretKey) throws javax.jms.JMSException
- Specified by:
createConnection
in interfacejavax.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 interfacejavax.jms.QueueConnectionFactory
- Throws:
javax.jms.JMSException
-
-