Spring module to be used as dependency that pre-configures and initializes commonly used. This would same boilerplate configuration as well as unify the logging mechanisim, making it easiser for log monitoring tools.
- API and Service Logging
- uses AOP to configure MDC context traceable map and produce logs across pointcuts for
@Controller
and@Service
- uses AOP to configure MDC context traceable map and produce logs across pointcuts for
- Thread Pool
- Configure thread pool for
@Async
processes using the provided properties, otherwise falls back to pre-configured values.
- Configure thread pool for
AbstractClientRequestService
- "Decorator" for internal request service
- Handles request headers authentication
- Validates the request and response bodies, using Bean Validation
- Sets MDC context map for AOP logging
- Email service +
- API Authorization
- Secures API endpoints using
<ROLE>,<URI>
pair list. - Requests with valid JWT tokens gets access to their
<ROLE>
endpoints.
- Secures API endpoints using
- Health Indicators and schduled reports
- Plugins the Spring Auctator
- Add repository to
pom.xml
:
<project>
<!-- ..... -->
<!-- see https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#publishing-a-package -->
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Apache Maven Packages</name>
<url>https://maven.pkg.github.com/yoga1290/microkernel-core-system</url>
</repository>
</distributionManagement>
</project>
- Another option would be to, clone this repo, and run:
mvn clean install
Add <dependency>
into pom.xml
of the disered app:
<dependency>
<groupId>yoga1290</groupId>
<artifactId>microkernel-core-system</artifactId>
<version>1.0.0</version>
</dependency>
<!-- TBA: will add <repository> later on; gonna make use of github maven registry & github actions -->
To scan the required components/package, you will need to add this entrypoint class:
import yoga1290.commons.ImportCommons;
//...
@SpringBootApplication
@Import({ ImportCommons.class})
//..
- Spring | Custom Logs Configuration
- Baeldung | Guide to Spring Email
- Your First Full Stack Application with Angular and Spring Boot
- DZone | Setting Up MDC Context With AOP in Spring Boot Applications
- Mkyong | package javax.validation.constraints does not exist
- Spring | Spring Security without the WebSecurityConfigurerAdapter