I'm trying use the spring-cloud-aws-jdbc in my project, but when I receive a large number of user I have a problem, It seems like my pool of connections is full.
Exception: Pool empty. Unable to fetch a connection in 30 seconds, none available[size:100; busy:100; idle:0; lastwait:30000]
I have used C3P0 in it with no problem. Is possible I use C3P0 for pool connection instead Tomcat pool?
Hey guys ... question to spring-cloud-aws / multiple listeners on one queue
class A{
@SqsListener(value = "some-queue", deletionPolicy = ON_SUCCESS)
public void onMessageReceived1(String payload, @Header(TYPE) String messageType) {}
}
class B {
@SqsListener(value = "some-queue", deletionPolicy = ON_SUCCESS)
public void onMessageReceived2(@Payload SomeMessagePayload message, @Header(TYPE) String messageType) {}
}
would that work? btw. is the Method Name taken into account?
I got "Ambiguous handler methods mapped for destination " when both methods are called "onMessageReceived"
Hi all, When i am using @SqsListener with Object its not getting the value
@SqsListener("Demo")
public void processMessage(Person person) {
System.out.println("Message Received - " + person.getName());
}
I get the value - Message Received - null
When i debug i can see the GenericMessage payload with actual value. I thought If jackson library is in class path message converstion happens automatically
I have configured QueueMessageHandlerFactory with StrictContentTypeMatch- false
@Bean
public QueueMessageHandlerFactory queueMessageHandlerFactory() {
QueueMessageHandlerFactory factory = new QueueMessageHandlerFactory();
MappingJackson2MessageConverter messageConverter = new MappingJackson2MessageConverter();
//set strict content type match to false
messageConverter.setStrictContentTypeMatch(false);
factory.setArgumentResolvers(Collections.singletonList(new PayloadMethodArgumentResolver(messageConverter)));
return factory;
}
Hi
I've upgraded from spring-boot from 2.2.2.RELEASE to 2.2.4.RELEASE. and this seems to change the behavior of the sent metrics to aws (I'm getting lot's of The parameter MetricData.member.7.Dimensions.member.5.Value is required.) I'm using io.micrometer:micrometer-registry-cloudwatch:1.3.2 (I've also tried 1.3.3), on a separate note I've just noticed that io.micrometer:micrometer-registry-cloudwatch is now deprecated and that there is a io.micrometer:micrometer-registry-cloudwatch2 (I've tried this one but it fails to be picked up by spring)
so the questions are:
thanks in advance
@nbenjamin I've seen that problem, in a nutshell you seem to be expecting a raw message, but you are getting a wrapped message, try to change your mapping from:
foo(Person person){} to foo (@NotificationMessage Person person) I'm assuming this is the listener (your queue on aws should not send the raw message)
@Enable
classes. This would allow us move all configuration completely to autoconfigure
module and use Spring Boot @Conditional
annotations. There we could use ObjectProvider
s
Intellij_Spring_Boot_Java_Conventions
file supersedes the eclipse-code-formatter.xml
? While reading the README
in the coding conventions it says to install the Eclipse Formatter for IntelliJ while in the IntelliJ IDE setup one should use the coding conventions from Spring Cloud Build?
@Slf4j
@Component
public class MyListener {
@SqsListener("my-queue")
public void handler(Foo foo) {
log.debug(foo);
}
@SqsListener("my-queue")
public void otherHandler(Bar bar) {
log.debug(bar);
}
}
2020.0.0-M1
release: Spring Cloud AWS and Spring Cloud GCP are no longer part of the release train. They will continue to be part of Hoxton as long as it is supported – at least thru June of 2021.
(https://spring.io/blog/2020/04/17/spring-cloud-2020-0-0-m1-released). Having read through a few PRs in the project, it looks like Spring Cloud AWS 3.0 will be a major release. Is it just the case that Spring Cloud AWS is no longer part of the Spring Cloud release train?
Hi guys. I want to implement concurrency (multiple workers) in the SqsListeners. I already have several projects that use that same implementation (as a library). Ideally, keep the implementation with the annotation (@SqsListener) and make the changes in the configuration class
I read an AWS documentation about that, but it's a bit old, so I don't know if I need to change my implementation, or if there is a way to set the concurrency attributes in the config class.
Link: https://aws.amazon.com/blogs/developer/using-amazon-sqs-with-spring-boot-and-spring-jms/
The following is the implementation that I currently have, but I don't know how to set the concurrency attributes:
Config class
public class SqsConfig {
@Bean
public QueueMessagingTemplate queueMessagingTemplate(AmazonSQSAsync amazonSQSAsync) {
return new QueueMessagingTemplate(amazonSQSAsync);
}
@Bean
public AmazonSQS sqsClient() {
return AmazonSQSClientBuilder.defaultClient();
}
}
Consumer class:
@Service
public class Consumer implements ISqsStandardConsumer{
@Override
@SqsListener("SQS-concurrency-test")
public void receiveStandardMessage(String message) {
System.out.println(message);
}
}
I really appreciate your comments
Hello I don't know if this is a bug or simple spring cloud aws doesn't support this.
In order to have access to my aws account from AWS CLi, I have to login through a npm app called aws-azure-login and this redirects me to my organization login page and creates and all the information necessary on .aws/config file and .aws/credentials.


.aws/config


[profile landing-zone-iam]
azure_tenant_id=7e4c72b8-86d8-4e4a-90d8-4f7b7b2513c4
azure_app_id_uri=https://signin.aws.amazon.com/saml
azure_default_username=email@email.com
azure_default_role_arn=
azure_default_duration_hours=10
.aws/credentials


[landing-zone-iam]
aws_access_key_id=ASIAVAXUICQBJKDAHRSU
aws_secret_access_key=z+uN+nklhHLC5RbAQQK8AnMgIV8vAbFIr3iJR5Cg
aws_session_token=FwoGZXIvYXdzEGsaDGWJ/5ZJZgsV3mRkaiKpAttDP2k7Pkcog04eQvT64bqtTf6cyGW5A+tGBC1vCo6HWnqFQCorPTyaftKk4EDvlenwMk8tYBMgtuGk+I9fMcuFpczuEipEKC4Bmbff9NlwZf7NyqY0xMLG28SQG7p9RZ2OX7mQ0OxT9r7xGCpmt6+nuuykHQRM+vjIAejFu8IgOJvxsYqCB+LuNkgVeT9gEjxAsJKKpD3wyJbiyDCJd+RVDEW+smxQ1fO3PqAX0H9F8MOJfaKpzb8m6bMKgWH59Vg9yb6wW5SnoKcR9m/kt546VO1FYwpnEgWHk/chFivey0iBTxWHz3CMA8ga7e5jtmFNt2/vPLZCoXHyyE194l9i7oPbOGNQn/gpkLF7B43N+s/t/KQe8Uek+xp4tjEtar2+nxFZfZTFLyiclKn5BTIq5dpEXmpQmCkCNgjkpx+kBXNESDnoGu0sTSBleltUemcqZkOT3I9PRC8o
aws_expiration=2020-08-20T20:02:04.000Z
[app-dev]
role_arn=arn:aws:iam::792079637043:role/admin-role
region=eu-west-1
source_profile=landing-zone-iam
external_id=1234
role_session_name=session_name
I can use the cli e.g aws s3 ls - -profile app-dev and I have results

If I try to use spring cloud aws I cannot run the application 


application.properties


spring.application.name=demo-aws
cloud.aws.stack.auto=false
cloud.aws.credentials.use-default-aws-credentials-chain=true
cloud.aws.region.use-default-aws-region-chain=true
cloud.aws.credentials.profile-name=app-dev
Exception:

Caused by: com.amazonaws.SdkClientException: Unable to load region information from any provider in the chain
at com.amazonaws.regions.AwsRegionProviderChain.getRegion(AwsRegionProviderChain.java:59) ~[aws-java-sdk-core-1.11.792.jar:na]

Does Spring Cloud AWS support this kind of authentication ?


@SqsListener
call. I'd like to autowire certain data through the call cycle but it appears like request
doesn't work and I don't believe any of the other scopes by default support that.
I'm trying to deploy a Spring Boot application to AWS Beanstalk. A year ago I wrote an article on how to do it but now those same instructions fail: https://www.baeldung.com/spring-boot-deploy-aws-beanstalk
I've tried with an without Spring Cloud AWS enabled. In the one profile I exclude:
org.springframework.cloud.aws.autoconfigure.cache.ElastiCacheAutoConfiguration,\
org.springframework.cloud.aws.autoconfigure.context.ContextCredentialsAutoConfiguration,\
org.springframework.cloud.aws.autoconfigure.context.ContextInstanceDataAutoConfiguration,\
org.springframework.cloud.aws.autoconfigure.context.ContextRegionProviderAutoConfiguration,\
org.springframework.cloud.aws.autoconfigure.context.ContextResourceLoaderAutoConfiguration,\
org.springframework.cloud.aws.autoconfigure.context.ContextStackAutoConfiguration,\
org.springframework.cloud.aws.autoconfigure.jdbc.AmazonRdsDatabaseAutoConfiguration,\
org.springframework.cloud.aws.autoconfigure.mail.MailSenderAutoConfiguration,\
org.springframework.cloud.aws.autoconfigure.messaging.MessagingAutoConfiguration,\
org.springframework.cloud.aws.autoconfigure.metrics.CloudWatchExportAutoConfiguration
In the other profile I only excluded:
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,\
org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration,\
org.springframework.cloud.aws.autoconfigure.cache.ElastiCacheAutoConfiguration,\
org.springframework.cloud.aws.autoconfigure.mail.MailSenderAutoConfiguration,\
org.springframework.cloud.aws.autoconfigure.messaging.MessagingAutoConfiguration
So the AmazonRdsDatabaseAutocConfiguration should be active.
I tried with the RDS database as part of Beanstalk application and as a separate RDS database instance.
It can't be this difficult.
Adding spring-cloud-starter-aws-secrets-manager-config
to 2.3.4.RELEASE - Hoxton.SR8
, project throws the following:
com.amazonaws.util.EC2MetadataUtils : Unable to retrieve the requested metadata (/latest/meta-data/instance-id).
Failed to connect to service endpoint:
com.amazonaws.SdkClientException: Failed to connect to service endpoint:
at com.amazonaws.internal.EC2ResourceFetcher.doReadResource(EC2ResourceFetcher.java:100) ~[aws-java-sdk-core-1.11.792.jar:na]
....
Caused by: java.net.SocketTimeoutException: connect timed out
But downgrading the springCloudVersion
to Hoxton.SR6
do fix it.