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

Modern software architecture is often broken. Slow delivery leads to missed opportunities, innovation is stalled due to architectural complexities, and engineering resources are exceedingly expensive.

Orkes is the leading workflow orchestration platform built to enable teams to transform the way they develop, connect, and deploy applications, microservices, AI agents, and more.

With Orkes Conductor managed through Orkes Cloud, developers can focus on building mission critical applications without worrying about infrastructure maintenance to meet goals and, simply put, taking new products live faster and reducing total cost of ownership.

Try a 14-Day Free Trial of Orkes Conductor today.

Partner – Orkes – NPI EA (tag=Microservices)
announcement - icon

Modern software architecture is often broken. Slow delivery leads to missed opportunities, innovation is stalled due to architectural complexities, and engineering resources are exceedingly expensive.

Orkes is the leading workflow orchestration platform built to enable teams to transform the way they develop, connect, and deploy applications, microservices, AI agents, and more.

With Orkes Conductor managed through Orkes Cloud, developers can focus on building mission critical applications without worrying about infrastructure maintenance to meet goals and, simply put, taking new products live faster and reducing total cost of ownership.

Try a 14-Day Free Trial of Orkes Conductor today.

eBook – Guide Spring Cloud – NPI EA (cat=Spring Cloud)
announcement - icon

Let's get started with a Microservice Architecture with Spring Cloud:

>> Join Pro and download the eBook

eBook – Mockito – NPI EA (tag = Mockito)
announcement - icon

Mocking is an essential part of unit testing, and the Mockito library makes it easy to write clean and intuitive unit tests for your Java code.

Get started with mocking and improve your application tests using our Mockito guide:

Download the eBook

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

Handling concurrency in an application can be a tricky process with many potential pitfalls. A solid grasp of the fundamentals will go a long way to help minimize these issues.

Get started with understanding multi-threaded applications with our Java Concurrency guide:

>> Download the eBook

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

Spring 5 added support for reactive programming with the Spring WebFlux module, which has been improved upon ever since. Get started with the Reactor project basics and reactive programming in Spring Boot:

>> Join Pro and download the eBook

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

Since its introduction in Java 8, the Stream API has become a staple of Java development. The basic operations like iterating, filtering, mapping sequences of elements are deceptively simple to use.

But these can also be overused and fall into some common pitfalls.

To get a better understanding on how Streams work and how to combine them with other language features, check out our guide to Java Streams:

>> Join Pro and download the eBook

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 – LS – NPI EA (cat=Jackson)
announcement - icon

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

>> LEARN SPRING
Course – RWSB – NPI EA (cat=REST)
announcement - icon

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

>> The New “REST With Spring Boot”

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 – LambdaTest – NPI EA (cat=Testing)
announcement - icon

Browser testing is essential if you have a website or web applications that users interact with. Manual testing can be very helpful to an extent, but given the multiple browsers available, not to mention versions and operating system, testing everything manually becomes time-consuming and repetitive.

To help automate this process, Selenium is a popular choice for developers, as an open-source tool with a large and active community. What's more, we can further scale our automation testing by running on theLambdaTest cloud-based testing platform.

Read more through our step-by-step tutorial on how to set up Selenium tests with Java and run them on LambdaTest:

>> Automated Browser Testing With Selenium

Partner – Orkes – NPI EA (cat=Java)
announcement - icon

Modern software architecture is often broken. Slow delivery leads to missed opportunities, innovation is stalled due to architectural complexities, and engineering resources are exceedingly expensive.

Orkes is the leading workflow orchestration platform built to enable teams to transform the way they develop, connect, and deploy applications, microservices, AI agents, and more.

With Orkes Conductor managed through Orkes Cloud, developers can focus on building mission critical applications without worrying about infrastructure maintenance to meet goals and, simply put, taking new products live faster and reducing total cost of ownership.

Try a 14-Day Free Trial of Orkes Conductor today.

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

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

Refactor Java code safely — and automatically — with OpenRewrite.

Refactoring big codebases by hand is slow, risky, and easy to put off. That’s where OpenRewrite comes in. The open-source framework for large-scale, automated code transformations helps teams modernize safely and consistently.

Each month, the creators and maintainers of OpenRewrite at Moderne run live, hands-on training sessions — one for newcomers and one for experienced users. You’ll see how recipes work, how to apply them across projects, and how to modernize code with confidence.

Join the next session, bring your questions, and learn how to automate the kind of work that usually eats your sprint time.

eBook – Guide Spring Cloud – NPI (cat=Cloud/Spring Cloud)
announcement - icon

Let's get started with a Microservice Architecture with Spring Cloud:

>> Join Pro and download the eBook

1. Introduction

Spring Cloud Config is a library that makes it easy to externalize configuration for Spring applications. It allows us to expose configuration data as a service, making it easy to ingest from any other application that has an HTTP client.

In this tutorial, we will look at how to use Spring Cloud Config without git.

2. Spring Cloud Config Overview

The Spring Cloud Config library is a typical client-server model. A centralized server (or servers) reads in configuration data from some external data source. These servers expose various HTTP endpoints that allow any other application to query for configuration data.

spring cloud config overview

Spring Cloud Config Overview

Spring Cloud Config also makes it very easy to connect from a Spring Boot application to a config server automatically. The configuration data that is provided by the server can then be used just like any other properties source inside the client application.

3. Git Providers

The most common use case for Spring Cloud Config is to store configuration data inside a git repository. This type of setup has several advantages:

  • Flexibility: A git repository can hold various file types, including binary.
  • Security: Easy to control both read and write access at a granular level.
  • Auditing: Robust history tracking allows easy auditing of configuration changes.
  • Standardized: Git operations are standard regardless of provider, meaning we can self-host or use any number of 3rd party providers.
  • Distributed: Git is designed from the ground up to be distributed, so it’s a great fit for cloud-native and microservice architectures.

Despite all the benefits listed above, however, git may not always be the best choice for storing configuration data. For example, our organization may already put configuration data in another data store like a relational database. In this case, it may not be worth the effort to migrate it to git.

In the next section, we’ll take a closer look at using Spring Cloud Config without git.

4. Using Spring Cloud Config Without Git

When we talk about using something other than git with Spring Cloud Config, we are really referring to the server component. Our choice of data store does not impact the client component. Only the server is impacted.

Inside the Spring Cloud Config Server library, there’s a single interface named EnvironmentRepository that defines a configuration source. All configuration sources, both git and otherwise, must implement this interface.

Let’s look at some of the provided implementations.

3.1. File System

Spring Cloud Config provides support for using a file system as a configuration source. To enable this feature, we have to specify the following value in the config server’s application.properties file:

spring.cloud.config.server.native.search-locations=resources/other.properties

By default, the search location assumes a classpath resource. If we want to use any arbitrary file, we simply include a file resource prefix:

spring.cloud.config.server.native.search-locations=file:///external/path/other.properties

In addition to this property, the config server needs to run with the native profile enabled:

-Dspring.profiles.active=native

It’s important to remember that when using a file system configuration source, we need to ensure the file system is available everywhere the config server will run. This likely means using a distributed file system such as NFS.

3.2. JDBC

Spring Cloud Config can also use a relational database to load configuration data using JDBC. This is accomplished via the JdbcEnvironmentRepository class. To enable this class, we have to follow a few steps.

First, the spring-jdbc library must be present on the classpath. If we’re already using Spring Data JDBC or another dependent library, it will already be present. Otherwise, we can always specify it manually:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jdbc</artifactId>
</dependency>

Second, we need to specify how to connect to the database:

spring.datasource.url=jdbc:mysql://dbhost:3306/springconfig
spring.datasource.username=dbuser
spring.datasource.password=dbpassword
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

In this case, we’re using MySQL, but any JDBC-compliant driver will work.

Next, the database must include a table named PROPERTIES that has the following columns:

  • APPLICATION
  • PROFILE
  • LABEL
  • KEY
  • VALUE

And finally, we need to specify the JDBC profile for the config server:

-Dspring.profiles.active=jdbc

3.3. Redis

Spring Cloud Config also supports Redis as a configuration source. This is accomplished using the RedisEnvironmentRepository class. Similar to the JDBC source, we need to follow a few steps to enable it.

First, we need to add a dependency to Spring Data Redis:

<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-redis</artifactId>
</dependency>

Second, we need to set some properties for how to connect to Redis:

spring.redis.host=localhost
spring.redis.port=6379

Next, we have to ensure our properties are stored properly in Redis. We can use the HMSET command to store some sample properties:

HMSET application sample.property.name1 "somevalue" sample.property.name2 "anothervalue"

If we were to echo back these properties, we should see the following data:

HGETALL application
{
    "sample.property.name1": "somevalue",
    "sample.property.name2": "anothervalue"
}

Finally, we must enable the Redis profile for our Spring Cloud Config server:

-Dspring.profiles.active=redis

Using Redis as a configuration source also supports different profiles. To do this, we simply add the profile name to the end of the application:

HMSET application-dev sample.property.name1 "somevalue" sample.property.name2 "anothervalue"

In this example, we’re creating a new set of properties under a profile named dev.

3.4. Secrets

A popular feature of many cloud providers is secrets. Secrets allow us to securely store sensitive data as part of our cloud infrastructure. These are perfect for things like usernames, hostnames, and passwords, which we would want to include as part of our application configuration.

Spring Cloud Config provides support for many different cloud secret providers. Below, we’ll look at AWS, which uses the AwsSecretsManagerEnvironmentRepository class to load AWS secrets into a property source.

This class relies on the AWSSecretsManager class to do the heavy lifting of communicating with AWS. While we could manually create it ourselves, the more straightforward solution is to use a Spring starter:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-aws-secrets-manager-config</artifactId>
    <version>2.2.6.RELEASE</version>
</dependency>

This module includes an auto-configuration that will create an instance of AWSSecretsManager for us. All we have to do is specify a set of properties in our bootstrap.yml file:

aws:
  secretsmanager:
    default-context: application
    prefix: /config
    profile-separator: _
    fail-fast: true
    name: ConfigServerApplication
    enabled: true

Now, let’s suppose we want to store our database credentials in a secret and make them available to the config server. We would simply create a new secret at the path /config/application/database_credentials. Inside, we would store the necessary key/value pairs required to connect to the database.

This construct also supports different profiles. For example, if we have a development database server, we could also create a separate secret for it. We would name it /config/application/database_credentials_dev.

3.5. S3

Another convenient way to store configuration is with cloud file services. Let’s take a look at how we can use AWS S3 as a configuration source.

First, we need to add the AWS SDK to our project:

<dependency>
    <groupId>com.amazonaws</groupId>
    <artifactId>aws-java-sdk-s3outposts</artifactId>
    <version>1.12.150</version>
</dependency>

Then, we need to provide some values to configure a connection to the S3 bucket that contains our property files:

amazon.s3.access-key=key
amazon.s3.secret-key=secret

And, we’ll need to supply specific properties for the AWS S3 configuration provider:

spring:
  cloud:
    config:
      server:
        awss3:
          region: us-east-1
          bucket: config-bucket

We also need to set a profile to ensure the AWS S3 configuration source is loaded:

-Dspring.profiles.active=awss3

All that’s left is to create our desired property files, including any profile-specific files, inside the bucket. Note that when an application doesn’t have a profile, the config server assumes default. Therefore, we should include a file with this suffix along with any other files that contain specific profile names.

3.6. Custom Configuration Source

If any of the provided configuration sources don’t meet our needs, we always have the option of implementing our own. In general, this involves creating a new class that implements both EnvironmentRepository and Ordered:

public class CustomConfigurationRepository implements EnvironmentRepository, Ordered {
    @Override
    public Environment findOne(String application, String profile, String label) {
        // Return a new Environment that is populated from
        // our desired source (DB, NoSQL store, etc)
    }

    @Override
    public int getOrder() {
        // Define our order relative to other configuration repositories
        return 0;
    }
}

Then, we simply instantiate this class as a new Spring bean:

@Bean
public CustomConfigurationRepository customConfigurationRepository() {
    return new CustomConfigurationRepository();
}

4. Multiple Configuration Sources

In some cases, it may be necessary to run Spring Cloud Config with multiple configuration sources. In this case, we have to specify a couple of pieces of data.

Let’s say we want to run with both JDBC and Redis as configuration sources. The first thing we need to do is define the order of each source in our bootstrap.yml file:

spring:
  cloud:
    config:
      server:
        redis:
          order: 2
        jdbc:
          order: 1

This allows us to specify the precedence for which configuration sources should be used before others. Because the ordering follows the normal Spring Ordered annotation processing, lower number sources will be checked first.

Additionally, we need to define both profiles for the server:

-Dspring.profiles.active=jdbc,redis

Note that we could specify the active profiles in the YAML as well. And, this same pattern could be used to define any number of configuration sources.

5. Conclusion

In this article, we’ve covered various configuration sources that can be used with Spring Cloud Config. While git is a great default source for many projects, it may not always be the best choice. We have seen that Spring Cloud Config provides multiple alternatives, as well as the ability to create custom providers.

Baeldung Pro – NPI EA (cat = Baeldung)
announcement - icon

Baeldung Pro comes with both absolutely No-Ads as well as finally with Dark Mode, for a clean learning experience:

>> Explore a clean Baeldung

Once the early-adopter seats are all used, the price will go up and stay at $33/year.

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

Modern software architecture is often broken. Slow delivery leads to missed opportunities, innovation is stalled due to architectural complexities, and engineering resources are exceedingly expensive.

Orkes is the leading workflow orchestration platform built to enable teams to transform the way they develop, connect, and deploy applications, microservices, AI agents, and more.

With Orkes Conductor managed through Orkes Cloud, developers can focus on building mission critical applications without worrying about infrastructure maintenance to meet goals and, simply put, taking new products live faster and reducing total cost of ownership.

Try a 14-Day Free Trial of Orkes Conductor today.

Partner – Orkes – NPI EA (tag = Microservices)
announcement - icon

Modern software architecture is often broken. Slow delivery leads to missed opportunities, innovation is stalled due to architectural complexities, and engineering resources are exceedingly expensive.

Orkes is the leading workflow orchestration platform built to enable teams to transform the way they develop, connect, and deploy applications, microservices, AI agents, and more.

With Orkes Conductor managed through Orkes Cloud, developers can focus on building mission critical applications without worrying about infrastructure maintenance to meet goals and, simply put, taking new products live faster and reducing total cost of ownership.

Try a 14-Day Free Trial of Orkes Conductor today.

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

The Apache HTTP Client is a very robust library, suitable for both simple and advanced use cases when testing HTTP endpoints. Check out our guide covering basic request and response handling, as well as security, cookies, timeouts, and more:

>> Download the eBook

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

Handling concurrency in an application can be a tricky process with many potential pitfalls. A solid grasp of the fundamentals will go a long way to help minimize these issues.

Get started with understanding multi-threaded applications with our Java Concurrency guide:

>> Download the eBook

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

Since its introduction in Java 8, the Stream API has become a staple of Java development. The basic operations like iterating, filtering, mapping sequences of elements are deceptively simple to use.

But these can also be overused and fall into some common pitfalls.

To get a better understanding on how Streams work and how to combine them with other language features, check out our guide to Java Streams:

>> Join Pro and download the eBook

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

Working on getting your persistence layer right with Spring?

Explore the eBook

Course – LS – NPI EA (cat=REST)

announcement - icon

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

>> CHECK OUT THE COURSE

Partner – Moderne – NPI EA (tag=Refactoring)
announcement - icon

Modern Java teams move fast — but codebases don’t always keep up. Frameworks change, dependencies drift, and tech debt builds until it starts to drag on delivery. OpenRewrite was built to fix that: an open-source refactoring engine that automates repetitive code changes while keeping developer intent intact.

The monthly training series, led by the creators and maintainers of OpenRewrite at Moderne, walks through real-world migrations and modernization patterns. Whether you’re new to recipes or ready to write your own, you’ll learn practical ways to refactor safely and at scale.

If you’ve ever wished refactoring felt as natural — and as fast — as writing code, this is a good place to start.

eBook Jackson – NPI EA – 3 (cat = Jackson)
eBook – eBook Guide Spring Cloud – NPI (cat=Cloud/Spring Cloud)