Following is my spring configuration for aws sqs.
<bean id="CredentialsProviderBean"
class="com.myapp.util.ClasspathPropertiesFileCredentialsProvider" />
<bean id="ConnectionFactoryBuilder"
class="com.amazon.sqs.javamessaging.SQSConnectionFactory$Builder">
<property name="regionName" value="us-east-1" />
<property name="numberOfMessagesToPrefetch" value="1" />
<property name="awsCredentialsProvider" ref="CredentialsProviderBean" />
</bean>
<bean id="ConnectionFactory" class="com.amazon.sqs.javamessaging.SQSConnectionFactory"
factory-bean="ConnectionFactoryBuilder" factory-method="build" />
<bean id="Connection" class="javax.jms.Connection" factory-bean="ConnectionFactory"
factory-method="createConnection" init-method="start" destroy-method="close" />
<bean id="QueueName" class="java.lang.String">
<constructor-arg value="myqueue" />
</bean>
<bean id="amazonMessageListener" class="com.myapp.daemon.AsyncMessageListener" />
<bean id="messageListener"
class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
<property name="delegate" ref="amazonMessageListener" />
<property name="defaultListenerMethod" value="onMessage" />
<property name="messageConverter">
<null />
</property>
</bean>
<bean id="jmsContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="ConnectionFactory" />
<property name="destinationName" ref="QueueName" />
<property name="messageListener" ref="messageListener" />
</bean>
I am having trouble understanding how to set this up in the AWS.
ElasticBeanStalk provides 2 types of environments, 1. worker and 2. webserver.
Thought the worker type environment fits the bill, according to the documentation. AWS deploys a daemon in ec2 instances, and pulls off the message from SQS and envelopes that into a message body of the http post request. This post request can be used to post to a web server.
However the component I wrote does that. Pulls off the message from the queue, and does some background processing.
In this case which environment type should i opt?