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 forSqsClientas well as settingnumberOfMessagesToPrefetch.The
numberOfMessagesToPrefetchparameter 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 SQSreceiveMessagecall to return.If more physical connections than the default maximum value (that is 50 as of today) are needed on the connection pool,
ClientOverrideConfigurationneeds to be configured.None of the
createConnectionmethods 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 SQSConnectioncreateConnection()SQSConnectioncreateConnection(String awsAccessKeyId, String awsSecretKey)SQSConnectioncreateConnection(software.amazon.awssdk.auth.credentials.AwsCredentials awsCredentials)SQSConnectioncreateConnection(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider awsCredentialsProvider)javax.jms.QueueConnectioncreateQueueConnection()javax.jms.QueueConnectioncreateQueueConnection(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:
createConnectionin interfacejavax.jms.ConnectionFactory- Throws:
javax.jms.JMSException
-
createConnection
public SQSConnection createConnection(String awsAccessKeyId, String awsSecretKey) throws javax.jms.JMSException
- Specified by:
createConnectionin 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:
createQueueConnectionin interfacejavax.jms.QueueConnectionFactory- Throws:
javax.jms.JMSException
-
-