-4

I'm interested is it possible to disable features into Spring Boot/Cloud which are not used?

If there is no way to remove a lot of the necessary features? Do you know some guide how I can make a custom build?

I'm interested how Spring Boot can be optimized for read-time processing.

Peter Penzov
  • 1,126
  • 134
  • 430
  • 808

2 Answers2

1

You can exclude features as tomcat from starter's dependency:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <exclusions>
        <exclusion>
            <artifactId>tomcat-embed-el</artifactId>
            <groupId>org.apache.tomcat.embed</groupId>
        </exclusion>
        <exclusion>
            <artifactId>tomcat-embed-core</artifactId>
            <groupId>org.apache.tomcat.embed</groupId>
        </exclusion>
        <exclusion>
            <artifactId>tomcat-embed-websocket</artifactId>
            <groupId>org.apache.tomcat.embed</groupId>
        </exclusion>
    </exclusions>
</dependency>

Or similar for Logback by removing from build or classpath:

Spring Boot tries to work with whatever is in the classpath, so if you don't want logback, take it off the classpath.

Add exclusion to both the spring-boot-starter and spring-boot-starter-web to resolve the conflict.

Or cloud config/discovery:

#Disable discovery
spring.cloud.discovery.enabled = false    
#Disable cloud config and config discovery
spring.cloud.config.discovery.enabled = false
spring.cloud.config.enabled = false
Ori Marko
  • 56,308
  • 23
  • 131
  • 233
0

What are the features are you expecting to disable ?

If you feel any dependency is not used try tag in your pom.xml. So that you can cut down some dependency and make you application lightweight.