Package com.amazon.sqs.javamessaging
Class SQSConnectionFactory
java.lang.Object
com.amazon.sqs.javamessaging.SQSConnectionFactory
- All Implemented Interfaces:
jakarta.jms.ConnectionFactory,jakarta.jms.QueueConnectionFactory
public class SQSConnectionFactory
extends Object
implements jakarta.jms.ConnectionFactory, jakarta.jms.QueueConnectionFactory
A ConnectionFactory object encapsulates a set of connection configuration
parameters for
AmazonSQSClient 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,
ClientConfiguration 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.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionSQSConnectionFactory(ProviderConfiguration providerConfiguration) SQSConnectionFactory(ProviderConfiguration providerConfiguration, com.amazonaws.services.sqs.AmazonSQS client) SQSConnectionFactory(ProviderConfiguration providerConfiguration, com.amazonaws.services.sqs.AmazonSQSClientBuilder clientBuilder) -
Method Summary
Modifier and TypeMethodDescriptionstatic SQSConnectionFactory.Builderbuilder()Deprecated.createConnection(com.amazonaws.auth.AWSCredentials awsCredentials) createConnection(com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider) createConnection(String awsAccessKeyId, String awsSecretKey) jakarta.jms.JMSContextThis method is not supported.jakarta.jms.JMSContextcreateContext(int sessionMode) This method is not supported.jakarta.jms.JMSContextcreateContext(String userName, String password) This method is not supported.jakarta.jms.JMSContextcreateContext(String userName, String password, int sessionMode) This method is not supported.jakarta.jms.QueueConnectionjakarta.jms.QueueConnectioncreateQueueConnection(String userName, String password)
-
Constructor Details
-
SQSConnectionFactory
-
SQSConnectionFactory
public SQSConnectionFactory(ProviderConfiguration providerConfiguration, com.amazonaws.services.sqs.AmazonSQS client) -
SQSConnectionFactory
public SQSConnectionFactory(ProviderConfiguration providerConfiguration, com.amazonaws.services.sqs.AmazonSQSClientBuilder clientBuilder)
-
-
Method Details
-
createConnection
- Specified by:
createConnectionin interfacejakarta.jms.ConnectionFactory- Throws:
jakarta.jms.JMSException
-
createConnection
public SQSConnection createConnection(String awsAccessKeyId, String awsSecretKey) throws jakarta.jms.JMSException - Specified by:
createConnectionin interfacejakarta.jms.ConnectionFactory- Throws:
jakarta.jms.JMSException
-
createConnection
public SQSConnection createConnection(com.amazonaws.auth.AWSCredentials awsCredentials) throws jakarta.jms.JMSException - Throws:
jakarta.jms.JMSException
-
createConnection
public SQSConnection createConnection(com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider) throws jakarta.jms.JMSException - Throws:
jakarta.jms.JMSException
-
createContext
public jakarta.jms.JMSContext createContext()This method is not supported.- Specified by:
createContextin interfacejakarta.jms.ConnectionFactory
-
createContext
This method is not supported.- Specified by:
createContextin interfacejakarta.jms.ConnectionFactory
-
createContext
This method is not supported.- Specified by:
createContextin interfacejakarta.jms.ConnectionFactory
-
createContext
public jakarta.jms.JMSContext createContext(int sessionMode) This method is not supported.- Specified by:
createContextin interfacejakarta.jms.ConnectionFactory
-
createQueueConnection
public jakarta.jms.QueueConnection createQueueConnection() throws jakarta.jms.JMSException- Specified by:
createQueueConnectionin interfacejakarta.jms.QueueConnectionFactory- Throws:
jakarta.jms.JMSException
-
createQueueConnection
public jakarta.jms.QueueConnection createQueueConnection(String userName, String password) throws jakarta.jms.JMSException - Specified by:
createQueueConnectionin interfacejakarta.jms.QueueConnectionFactory- Throws:
jakarta.jms.JMSException
-
builder
Deprecated.Deprecated. Use one of the constructors of this class instead and provide either AmazonSQS client or AmazonSQSClientBuilder.
-