Skip to content

3.0.0

Compare
Choose a tag to compare
@sda-spring-boot-commons sda-spring-boot-commons released this 25 Sep 15:01
be9e076

3.0.0 (2023-09-25)

See the migration guide from v2 to v3.

Features

  • upgrade to spring boot 3 (be9e076)

  • feat: migrate spring security

  • feat(s3): refactor bucket repository to new AWS API

  • feat: migrating to open telemetry

  • feat(asyncapi): migrate AsyncAPI generation to Victools' schema generator

  • feat: removing module sda-commons-web-auto-configure

  • feat(kafka): use dlt-<topic> as default DLT pattern

  • feat(testing): support MongoDB testing with an external database

  • feat(web): support MetadataContext in PlatformClient

Bug Fixes

  • fix: jakarta imports and minor api changes

  • fix: bumping google-java-format to 1.17.0

  • fix(deps): bump spring docs to fix application context

  • fix(wiremock): ensure to not get Jetty as transitive dependency

  • fix(logging): update json logging configuration for Spring Boot 3

  • fix: remove servers from generated openapi

  • fix: IDE warnings and avoid discouraged field injection

  • fix(deps): avoid javax from swagger

  • fix(kafka): use double instead of int as backoff multiplier

  • fix: actuator changes after upgrading

  • fix: set correct properties for mongodb tests

  • fix(sda-commons-starter-web): replace server.max-http-header-size with server.max-http-request-header-size

  • fix(security): bump aws-java-sdk-s3, okio and snakeyaml

  • fix(deps): migrate Feign to Jakarta

  • fix(deps): bump springBootVersion to 3.1.3

  • fix(asyncapi): merge the same type if generated twice

Documentation

  • docs: fix JavaDoc warnings and use text blocks as advised by the IDE

  • docs: simplify structure and initial version of migration guide

  • docs(metadata): include metadata context in common documentation

  • docs: restructure config properties and optimize configuration

  • docs(migration): extend migration guide and documentation

  • docs(migration): add WireMock to migration guide

  • docs(build): describe compiler args for Spring Boot 3

Chore

  • chore(cve-check): restore ignore policy

  • chore(testing): use MongoDB 5.0 in integration test

  • chore: use smaller mongodb image

  • chore: not publishing releases in our internal nexus repository

BREAKING CHANGES

  • This release removes support for spring boot 2.x and spring cloud 2021.x. Check the migration guide to see how migrating your application.

  • WireMock changed from wiremock-jre8 to wiremock-jre8-standalone as suggested here.
    The standalone variant repackages transitive dependencies to a new package and avoids the dependency. Tests are affected if Jackson classes are used to interact with WireMock, e.g. .willReturn(jsonResponse(jacksonsJsonNode, 200)). All imports related to Jackson classes interacting with WireMock, including an ObjectMapper that is used to read or write these objects, must be updated from com.fasterxml.… to wiremock.com.fasterxml.….

  • starter-s3: The simple interface client com.amazonaws.services.s3.AmazonS3 (Java 1.x), available on version 2.x, was replaced by the service client software.amazon.awssdk.services.s3.S3Client (Java 2.x) in this version, so you should replace your autowired beans with this new service client and its methods. Check the migration guide for more information.

  • This release removes support from OpenTracing and Sleuth and uses OpenTelemetry with Micrometer Tracing as tracing provider.

AsyncAPI Generation

New Json Schema Generator

The current library used to create Json Schema has been replaced by Victools Json Schema Generator.

Reasons:

  • The old library is not maintained for 3 years.
  • Spring migrated from Javax to Jakarta. Old dependencies to javax.validation in the library mess up the dependency tree.

This change comes with some noticeable impact:

  • javax.validation annotations are not available anymore, jakarta.validation annotations can be used instead.
  • Library specific annotations are not available anymore. In specific, the JsonExamples is gone. The new Schema Generator only supports a single example per field by using Swaggers @Schema(example = "foo").
Changed Java API for AsyncAPI generation

The AsyncApiGenerator is not a @Component anymore. Tests that generate AsyncAPI don't need a Spring Context now.
Instead of autowiring AsyncApiGenerator and calling .builder() of the instance, AsyncApiGenerator.builder() is now a public static method.

Classes to embed as Json Schema are not configured in the AsyncApiGenerator anymore.
They are referenced as $ref: class://com.example.your.package.model.MessageClass in the AsyncAPI template.
The AsyncApiGenerator will create the schema, embed it in components/schemas and update the $reference.

Migration steps
  • Convert your test to a plain unit test without Spring Context.
  • Get the AsyncApiGenerator from the static builder() method.
  • Remove Java code that adds model class. (This code does not compile anymore.)
  • Add the classes as $ref: class://<fully-qualified-class-name> in the AsyncAPI template
  • Run the test to update the AsyncAPI result. Technically it will describe the same API but there will be differences in the yaml structure due to the new Json Schema library.
  • This release removes completely the module sda-commons-web-auto-configure and moves its files to sda-commons-starter-web.

  • sda.kafka.consumer.dlt.pattern now uses dlt-<topic> as default. If the old behaviour is desired (appending .DLT to the topic), you have to explicitly unset the property.

  • The sda-spring-boot-commons releases will not be available in SDA-SE internal Nexus anymore, so you must retrieve them from Maven Central, from now on.