use of org.springframework.jms.support.destination.DynamicDestinationResolver in project java-dynamic-sqs-listener by JaidenAshmore.
the class SqsListenersConfiguration method jmsListenerContainerFactory.
/**
* Create factory for attaching to the SQS Queues.
*
* @param amazonSqs the sqs client
* @param providerConfiguration configuration for this provided
* @return the JMS container factory used
*/
@Bean
public JmsListenerContainerFactory<DefaultMessageListenerContainer> jmsListenerContainerFactory(final AmazonSQSAsync amazonSqs, final ProviderConfiguration providerConfiguration) {
final DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(new SQSConnectionFactory(providerConfiguration, amazonSqs));
factory.setDestinationResolver(new DynamicDestinationResolver());
// This sets the default concurrency for each listener but it can be overridden by your JmsListener
factory.setConcurrency("10");
factory.setSessionAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE);
return factory;
}
Aggregations