SimpleProgramming/spring-boot-aws-sqs

Getting when I use SqsListener in the code

mdfazuluddin opened this issue · 1 comments

I am getting following error when I use SqsListener in the code.

2020-03-02 12:48:15.373 ERROR 16736 --- [ main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'simpleMessageListenerContainer' defined in class path resource [org/springframework/cloud/aws/messaging/config/annotation/SqsConfiguration.class]: Invocation of init method failed; nested exception is com.amazonaws.SdkClientException: Unable to load AWS credentials from any provider in the chain: [com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper@523d6bdb: Unable to load credentials from service endpoint, com.amazonaws.auth.profile.ProfileCredentialsProvider@58496c97: profile file cannot be null]

please suggest the fix.

In config file, above this function

public AmazonSQSAsync amazonSQSAsync()

Add @primary
@bean annotations