DbSchema is a super-flexible database designer, which can take you from designing the DB with your team all the way to safely deploying the schema .

The way it does all of that is by using a design model , a database-independent image of the schema, which can be shared in a team using GIT and compared or deployed on to any database.

And, of course, it can be heavily visual, allowing you to interact with the database using diagrams, visually compose queries, explore the data, generate random data, import data or build HTML5 database reports.

Take a look at DBSchema

Partner – Microsoft – NPI EA (cat= Spring Boot)
announcement - icon

Azure Spring Apps is a fully managed service from Microsoft (built in collaboration with VMware), focused on building and deploying Spring Boot applications on Azure Cloud without worrying about Kubernetes.

The Enterprise plan comes with some interesting features, such as commercial Spring runtime support, a 99.95% SLA and some deep discounts (up to 47%) when you are ready for production.

>> Learn more and deploy your first Spring Boot app to Azure.

And, you can participate in a very quick (1 minute) paid user research from the Java on Azure product team.

Partner – Aegik AB – NPI EA (cat=JPA)
announcement - icon

Slow MySQL query performance is all too common. Of course it is. A good way to go is, naturally, a dedicated profiler that actually understands the ins and outs of MySQL.

The Jet Profiler was built for MySQL only , so it can do things like real-time query performance, focus on most used tables or most frequent queries, quickly identify performance issues and basically help you optimize your queries.

Critically, it has very minimal impact on your server's performance, with most of the profiling work done separately - so it needs no server changes, agents or separate services.

Basically, you install the desktop application, connect to your MySQL server , hit the record button, and you'll have results within minutes:

out the Profiler

eBook – Guide Junit – NPI EA (cat=Java)
announcement - icon

A quick guide to materially improve your tests with Junit 5:

>> The Junit 5 handbook
eBook – Jackson – NPI EA (cat=Jackson)
announcement - icon

Do JSON right with Jackson

Download the E-book

eBook – HTTP Client – NPI EA (cat=Http Client-Side)
announcement - icon

Get the most out of the Apache HTTP Client

Download the E-book

eBook – Maven – NPI EA (cat = Maven)
announcement - icon

Get Started with Apache Maven:

Download the E-book

eBook – Persistence – NPI EA (cat=Persistence)
announcement - icon

Working on getting your persistence layer right with Spring?

Explore the eBook

eBook – RwS – NPI EA (cat=Spring MVC)
announcement - icon

Building a REST API with Spring?

Download the E-book

Course – RwS – NPI EA (cat=REST)
announcement - icon

Explore Spring Boot 3 and Spring 6 in-depth through building a full REST API with the framework:

REST With Spring (new)

Course – LS – NPI EA (cat=Spring)
announcement - icon

Get started with Spring and Spring Boot, through the reference Learn Spring course:

>> LEARN SPRING

Partner – Machinet – NPI EA (cat = Testing)
announcement - icon

The AI Assistant to boost Boost your productivity writing unit tests - Machinet AI .

AI is all the rage these days, but for very good reason. The highly practical coding companion, you'll get the power of AI-assisted coding and automated unit test generation .
Machinet's Unit Test AI Agent utilizes your own project context to create meaningful unit tests that intelligently aligns with the behavior of the code.
And, the AI Chat crafts code and fixes errors with ease, like a helpful sidekick.

Simplify Your Coding Journey with Machinet AI :

>> Install Machinet AI in your IntelliJ

Partner – Codium – NPI EA (cat = Testing)
announcement - icon

Get non-trivial analysis (and trivial, too!) suggested right inside your IDE or Git platform so you can code smart, create more value, and stay confident when you push.

Get CodiumAI for free and become part of a community of over 280,000 developers who are already experiencing improved and quicker coding.

Write code that works the way you meant it to:

CodiumAI. Meaningful Code Tests for Busy Devs

Partner – Bellsoft – NPI EA (cat = Spring)
announcement - icon

Looking for the ideal Linux distro for running modern Spring apps in the cloud?

Meet Alpaquita Linux : lightweight, secure, and powerful enough to handle heavy workloads.

This distro is specifically designed for running Java apps . It builds upon Alpine and features significant enhancements to excel in high-density container environments while meeting enterprise-grade security standards.

Specifically, the container image size is ~30% smaller than standard options, and it consumes up to 30% less RAM:

Alpaquita Containers now.

Course – LSS – NPI EA (cat=Spring Security)
announcement - icon

Yes, Spring Security can be complex, from the more advanced functionality within the Core to the deep OAuth support in the framework.

I built the security material as two full courses - Core and OAuth , to get practical with these more complex scenarios. We explore when and how to use each feature and code through it on the backing project .

You can explore the course here:

>> Learn Spring Security

Partner – DBSchema – NPI EA (tag = SQL)
announcement - icon

DbSchema is a super-flexible database designer, which can take you from designing the DB with your team all the way to safely deploying the schema .

The way it does all of that is by using a design model , a database-independent image of the schema, which can be shared in a team using GIT and compared or deployed on to any database.

And, of course, it can be heavily visual, allowing you to interact with the database using diagrams, visually compose queries, explore the data, generate random data, import data or build HTML5 database reports.

Take a look at DBSchema

Partner – Aegik AB – NPI EA (tag = SQL)
announcement - icon

Slow MySQL query performance is all too common. Of course it is. A good way to go is, naturally, a dedicated profiler that actually understands the ins and outs of MySQL.

The Jet Profiler was built for MySQL only , so it can do things like real-time query performance, focus on most used tables or most frequent queries, quickly identify performance issues and basically help you optimize your queries.

Critically, it has very minimal impact on your server's performance, with most of the profiling work done separately - so it needs no server changes, agents or separate services.

Basically, you install the desktop application, connect to your MySQL server , hit the record button, and you'll have results within minutes:

out the Profiler

Course – LSD – NPI EA (tag=Spring Data JPA)
announcement - icon

Spring Data JPA is a great way to handle the complexity of JPA with the powerful simplicity of Spring Boot .

Get started with Spring Data JPA through the guided reference course:

>> CHECK OUT THE COURSE

Course – LS – All
announcement - icon

Get started with Spring Boot and with core Spring, through the Learn Spring course:

>> CHECK OUT THE COURSE

1. Introduction

AWS Lambda is a serverless computing service provided by Amazon to reduce the configuration of servers, OS, Scalability, etc. AWS Lambda is capable of executing code on AWS Cloud.

It runs in response to events on different AWS resources, which triggers AWS Lambda functions. Pricing is pay-as-you-go, meaning we won’t spend our money on idle lambda functions.

This tutorial requires a valid AWS account; you can create one here .

2. Maven Dependencies

To enable AWS lambda, we need the following dependency in our project:

<dependency>
    <groupId>com.amazonaws</groupId>
    <artifactId>aws-lambda-java-core</artifactId>
    <version>1.1.0</version>
</dependency>

This dependency can be found in the Maven repository .

We also need the Maven Shade Plugin to build the lambda application:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>2.4.3</version>
    <configuration>
        <createDependencyReducedPom>false</createDependencyReducedPom>
    </configuration>
    <executions>
        <execution>
            <phase>package</phase>
	    <goals>
                <goal>shade</goal>
            </goals>
        </execution>
    </executions>
</plugin>

3. Create Handler

Simply put, to invoke a lambda function, we need to specify a handler; there are three ways of creating a handler:

  • Creating a custom MethodHandler
  • Implementing the RequestHandler interface
  • Implementing the RequestStreamHandler interface
  • Let’s see how to do it using code examples.

    3.1. Custom MethodHandler

    We’ll create a handler method that will be the entry point for incoming requests. We can use JSON format or primitive data types as input values.

    Also, the optional Context object will allow us to access useful information available within the Lambda execution environment:

    public class LambdaMethodHandler {
        public String handleRequest(String input, Context context) {
            context.getLogger().log("Input: " + input);
            return "Hello World - " + input;
    

    3.2. RequestHandler Interface

    We can also implement the RequestHandler into our class and override the handleRequest method, which will be our entry point for requests:

    public class LambdaRequestHandler
      implements RequestHandler<String, String> {
        public String handleRequest(String input, Context context) {
            context.getLogger().log("Input: " + input);
            return "Hello World - " + input;
    

    In this case, the input will be the same as in the first example.

    3.3. RequestStreamHandler Interface

    We can also implement RequestStreamHandler in our class and override the handleRequest method.

    The difference is that InputStream, ObjectStream and Context objects are being passed as parameters:

    public class LambdaRequestStreamHandler
      implements RequestStreamHandler {
        public void handleRequest(InputStream inputStream, 
          OutputStream outputStream, Context context) {
            String input = IOUtils.toString(inputStream, "UTF-8");
            outputStream.write(("Hello World - " + input).getBytes());
    

    4. Build Deployment File

    With everything configured, we can create the deployment file by simply running:

    mvn clean package shade:shade

    The jar file will be created under the target folder.

    5. Create Lambda Function via Management Console

    Sign in to AWS Amazon and then click on Lambda under services. This page will show the lambda functions list, which is already created.

    Here are the steps required to create our lambda:

  • “Select blueprint” and then select “Blank Function”
  • “Configure triggers” (in our case, we don’t have any triggers or events)
  • “Configure function”:
  • Name: Provide MethodHandlerLambda,
  • Description: Anything that describes our lambda function
  • Runtime: Select java8
  • Code Entry Type and Function Package: Select “Upload a .ZIP and Jar file” and click on the “Upload” button. Select the file which contains lambda code.
  • Under Lambda function handler and role:
  • Handler name: Provide lambda function handler name com.baeldung.MethodHandlerLambda::handleRequest
  • Role name: If any other AWS resources are used in the lambda function, provide access by creating/using the existing role and define the policy template.
  • Under Advanced settings:
  • Memory: Provide memory that our lambda function will use.
  • Timeout: Select a time for execution of the lambda function for each request.
  • Once you are done with all inputs, click “Next”, which will show you to review the configuration.
  • Once a review is completed, click on “Create Function”.
  • 6. Invoke the Function

    Once the AWS lambda function is created, we’ll test it by passing in some data:

  • Click on your lambda function from lists and then click on the “Test” button
  • A popup window will appear, which contains a dummy value for sending data. Override the data with “Baeldung”
  • Click on the “Save and test” button
  • On the screen, you can see the Execution result section with successfully returned output as:

    "Hello World - Baeldung"

    7. Conclusion

    In this quick intro article, we’ve created a simple AWS Lambda app using Java 8, deployed that to AWS and tested it.

    The full source code for the example app can be found on GitHub.

    Partner – Bellsoft – NPI EA (cat = Spring)
    announcement - icon

    Just published a new writeup on how to run a standard Java/Boot application as a Docker container, using the Liberica JDK on top of Alpaquita Linux:

    Spring Boot Application on Liberica Runtime Container.

    Partner – Bellsoft – NPI EA (cat = Spring)
    announcement - icon

    Looking for the ideal Linux distro for running modern Spring apps in the cloud?

    Meet Alpaquita Linux: lightweight, secure, and powerful enough to handle heavy workloads.

    This distro is specifically designed for running Java apps. It builds upon Alpine and features significant enhancements to excel in high-density container environments while meeting enterprise-grade security standards.

    Specifically, the container image size is ~30% smaller than standard options, and it consumes up to 30% less RAM:

    Alpaquita Containers now.

    Partner – Aegik AB – NPI EA (tag = SQL)
    announcement - icon

    Slow MySQL query performance is all too common. Of course it is.

    The Jet Profiler was built entirely for MySQL, so it's fine-tuned for it and does advanced everything with relaly minimal impact and no server changes.

    out the Profiler

    Partner – Codium – NPI EA (cat = Testing)
    announcement - icon

    Explore the secure, reliable, and high-performance Test Execution Cloud built for scale. Right in your IDE:

    CodiumAI. Meaningful Code Tests for Busy Devs

    Basically, write code that works the way you meant it to.

    Partner – Machinet – NPI EA (cat = Testing)
    announcement - icon

    AI is all the rage these days, but for very good reason. The highly practical coding companion, you'll get the power of AI-assisted coding and automated unit test generation.
    Machinet's Unit Test AI Agent utilizes your own project context to create meaningful unit tests that intelligently aligns with the behavior of the code.

    Simplify Your Coding Journey with Machinet AI:

    >> Install Machinet AI in your IntelliJ

    Course – LS – All
    announcement - icon

    Get started with Spring Boot and with core Spring, through the Learn Spring course:

    >> CHECK OUT THE COURSE

    res – Microservices (eBook) (cat=Cloud/Spring Cloud)