You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have upgraded my spring boot api version from 2.0 to 2.2.0 and java version from 8 to 11 .
Post above up-gradation I am unable to consume the SQS messages .
Please find the pom snippet below :
I have upgraded my spring boot api version from 2.0 to 2.2.0 and java version from 8 to 11 .
org.springframework.boot spring-boot-starter-parent 2.2.2.RELEASE org.springframework.cloud spring-cloud-dependencies Hoxton.SR2 pom import org.springframework spring-jms com.amazonaws amazon-sqs-java-messaging-lib 1.0.8 com.amazonaws aws-java-sdk 1.11.749Post above up-gradation I am unable to consume the SQS messages .
Please find the pom snippet below :
and to consume the message I am doing the following , please find the below code snippet
JmsConfig: (SQS Configuration class)
@configuration(proxyBeanMethods = false)
@EnableJms
public class JmsConfig {
org.apache.logging.log4j.Logger LOGGER = LogManager.getLogger("CONSOLE_JSON_APPENDER");
String concurrencyValue;
private SQSConnectionFactory sqsConnectionFactory;
@PostConstruct
public void init() {
LOGGER.info("Listening to the queue");
}
public JmsConfig() {
sqsConnectionFactory = new SQSConnectionFactory(new ProviderConfiguration(),
AmazonSQSClientBuilder.standard().withCredentials(new
DefaultAWSCredentialsProviderChain()));
}
@bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
concurrencyValue = String.valueOf(1);
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(this.sqsConnectionFactory);
factory.setConnectionFactory(sqsConnectionFactory);
factory.setDestinationResolver(new DynamicDestinationResolver());
factory.setConcurrency(concurrencyValue);
factory.setSessionAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE);
return factory;
}
Message Consumer Class :
@JmsListener(destination = "${ingestQueue}", containerFactory="jmsListenerContainerFactory")
public void processMessage(@payload String message) {
logLevel.logLevel();
System.out.println("Incomming Payload from SQS" + message);
Can someone help me what is the mistake I am doing here or what needs to be changed .
The text was updated successfully, but these errors were encountered: