Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS lambda : Spring boot 3 Servlet application having webflux dependency for web client #622

Open
bajajyog opened this issue Aug 19, 2023 · 3 comments
Labels

Comments

@bajajyog
Copy link

To help us debug your issue fill in the basic information below using the options provided

Serverless Java Container version: `2.0.0.M2

Implementations: `Spring Boot 3

Framework version: eg SpringBoot 3.1.2

Frontend service: REST API /ALB

Deployment method: eg SAM, Serverless Framework, Console

Scenario

Describe what you are trying to accomplish
I am having Spring boot 3 Microservice deployed as AWS lambda. This microservice contains Webflux dependnecy for Spring Reactive WebClient. I have excluded Netty dependency from WebFlux. AWS Java Serverless library considering AWS lambda as Reactibe but I want it to be Servlet.

Expected behavior

Describe how you would expect the application to behave
Please provide way to set up servlet web application type even it contains web flux dependency.
or
Check if spring web dependency is available, it should be servlet application

Spring is considering Reactive WebClient as synchronous in case spring web dependency is available

Actual behavior

Describe what you are seeing instead

Reactive web application type is considered by library

Steps to reproduce

Provide code samples we can use to reproduce the issue as part of our integration tests. If there is a public repository for the misbehaving application link to it here

handler = SpringBootLambdaContainerHandler.getAwsProxyHandler(Class.forName(System.getenv(APPLICATION)));

Full log output

Paste the full log output from the Lambda function's CloudWatch logs

logs
@mbfreder
Copy link
Contributor

Hi. To set up Servlet web application type, You can create your handler this way:

handler = new SpringBootProxyHandlerBuilder<AwsProxyRequest>()
                                .defaultProxy()
                                .servletApplication()
                                .springBootApplication(Class.forName(System.getenv(APPLICATION)))
                                .buildAndInitialize();

servletApplication() sets your application type to Servlet.

@bajajyog
Copy link
Author

Thanks for your quick feedback. Let me test thhis.

@deki
Copy link
Collaborator

deki commented Sep 18, 2023

@bajajyog do you need additional help or can we resolve this issue?

@deki deki added the question label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants