[#2845] Bump Spring boot to 4.x#2941
[#2845] Bump Spring boot to 4.x#2941avgustinmm wants to merge 1 commit intoeclipse-hawkbit:masterfrom
Conversation
7040ce8 to
16876ab
Compare
|
5dd08c9 to
c807bec
Compare
4d43be7 to
08b324c
Compare
ea94b1c to
25ea2f4
Compare
There was a problem hiding this comment.
Pull request overview
This PR performs a major framework/platform migration across the hawkBit multi-module build, primarily upgrading to Spring Boot 4.x and adapting the codebase to associated ecosystem changes (Spring Cloud, SpringDoc, Jackson 3, Jakarta/Boot package moves, retry abstraction changes, etc.).
Changes:
- Upgrade platform baseline to Spring Boot
4.0.5(plus Spring Cloud, SpringDoc, Vaadin, Spring Shell) and refactor starters/dependency management accordingly. - Migrate nullability annotations from Spring’s
@Nullable/@NonNullto JSpecify, and migrate JSON/event infrastructure to Jackson 3 /tools.jackson.*. - Adjust JPA/repository layer for Spring Data / EclipseLink changes (Specifications API changes, repository factory behavior), and add a Flyway migration for
SP_LOCK.
Reviewed changes
Copilot reviewed 169 out of 171 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| pom.xml | Bumps Spring Boot/Spring Cloud/SpringDoc; refactors dependency management; updates EclipseLink version and adds new version properties. |
| lombok.config | Enables JSpecify null annotation generation for Lombok. |
| hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/VaadinServiceInit.java | Formatting-only adjustment. |
| hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/MainLayout.java | Updates security annotation, navigation/default-view logic, and view priority list. |
| hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitUiApp.java | Tightens auth interceptor handling and switches URL construction to URI. |
| hawkbit-ui/pom.xml | Updates Vaadin/Spring Security starters; raises module Java version. |
| hawkbit-sdk/pom.xml | Centralizes OpenFeign versioning in parent; keeps SDK Java version property. |
| hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/Amqp.java | Updates Boot package for RabbitProperties. |
| hawkbit-sdk/hawkbit-sdk-dmf/pom.xml | Switches to spring-boot-starter-amqp. |
| hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/multidevice/MultiDeviceApp.java | Migrates Spring Shell annotations/API to Spring Shell 4. |
| hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/dmf/DmfApp.java | Migrates Shell annotations and Boot RabbitProperties package. |
| hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/device/DeviceApp.java | Migrates Shell annotations/API to Spring Shell 4. |
| hawkbit-sdk/hawkbit-sdk-demo/pom.xml | Upgrades Spring Shell and adds spring-shell-jline. |
| hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/Tenant.java | Switches nullability annotations to JSpecify. |
| hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitServer.java | Switches nullability annotations to JSpecify. |
| hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitClient.java | Migrates to tools.jackson ObjectMapper and adjusts signatures. |
| hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/Controller.java | Switches nullability annotations to JSpecify. |
| hawkbit-sdk/hawkbit-sdk-commons/pom.xml | Adds explicit commons-fileupload; adds Jackson 3 + hateoas dependency adjustments. |
| hawkbit-rest/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTest.java | Updates @AutoConfigureMockMvc package for Boot 4. |
| hawkbit-rest/hawkbit-rest-core/src/main/resources/hawkbit-security-defaults.properties | Adds default security properties file. |
| hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/RestConfiguration.java | Formatting/comment cleanup in exception handler area. |
| hawkbit-rest/hawkbit-rest-core/pom.xml | Adds SpringDoc API starter and webmvc test starter; adjusts HATEOAS dependency. |
| hawkbit-rest/hawkbit-rest-api/pom.xml | Aligns OpenAPI model dependency via springdoc BOM/import. |
| hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/TestdataFactory.java | Removes commons-io usage; uses ByteArrayInputStream. |
| hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/AbstractIntegrationTest.java | Replaces commons-io file deletion with custom recursive delete; adds helper methods. |
| hawkbit-repository/hawkbit-repository-test/pom.xml | Switches to spring-boot-starter-webmvc; fixes test starter scope. |
| hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/scheduler/AutoAssignHandlerIntTest.java | Test formatting + JSpecify usage for generic Slice return. |
| hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetManagementTest.java | Minor System.currentTimeMillis() cleanup. |
| hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutManagementTest.java | Formatting cleanup and import removal. |
| hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DeploymentManagementTest.java | Formatting cleanup. |
| hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ControllerManagementTest.java | Updates Mockito typing for Specification and retry max expectation. |
| hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ArtifactManagementTest.java | Removes commons-io usage; switches content compare to readAllBytes(). |
| hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/SystemExecutionTest.java | Updates matcher typing for Specification. |
| hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/AbstractJpaIntegrationTest.java | Updates Boot JpaProperties package. |
| hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/AbstractRemoteEventTest.java | Refactors event converter tests to use injected JsonMapper. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/specifications/ActionSpecifications.java | Introduces DeleteSpecification for delete use-cases. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/scheduler/JpaRolloutExecutor.java | Updates repository method name and time calls. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/rollout/condition/AbstractPauseRolloutGroupAction.java | Removes trailing whitespace/extra lines. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/repository/RolloutRepository.java | Workarounds for EclipseLink IN issues using Specifications. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/repository/RolloutGroupRepository.java | Workarounds for EclipseLink IN issues using criteria/spec. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/repository/NoCountSliceRepository.java | Switches @Nullable to JSpecify. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/repository/JpaSpecificationEntityGraphExecutor.java | Switches @Nullable to JSpecify. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/repository/HawkbitBaseRepository.java | Adjusts Specification null handling and operation type imports. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/repository/BaseEntityRepository.java | Switches @Nullable to JSpecify. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/repository/ActionRepository.java | Reworks status not in handling and renames exists query method. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/repository/ACMRepository.java | Updates nullability annotations and signatures around access-controlled operations. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/* | Replaces Spring Retry annotations with resilience/retry abstraction and updates constants usage. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaRepositoryConfiguration.java | Updates Boot package moves; enables resilient methods; entity scan package move. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/HawkbitBaseRepositoryFactoryBean.java | Adjusts repository factory to enforce base class and normalize null Specifications. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/configuration/Constants.java | Replaces retry numeric constants with property-based strings. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/acm/AccessControllerConfiguration.java | JSpecify/NullMarked updates for method-security handler overrides. |
| hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/acm/AccessController.java | Adds Update/Delete/Predicate Specifications support + JSpecify nullable annotations. |
| hawkbit-repository/hawkbit-repository-jpa/pom.xml | Dependency cleanup and test starter refactors (JPA test + micrometer test starter). |
| hawkbit-repository/hawkbit-repository-jpa-hibernate/src/main/java/org/eclipse/hawkbit/repository/jpa/* | Boot package moves; doc tweaks; switches to hibernate-processor. |
| hawkbit-repository/hawkbit-repository-jpa-hibernate/pom.xml | Switches to hibernate-processor. |
| hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/**/V1_20_1__spring_boot_4__*.sql | Adds SP_LOCK.EXPIRED_AFTER column migration per DB. |
| hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/java/.../HawkbitFlywayAutoConfiguration.java | Updates Boot Flyway auto-config package. |
| hawkbit-repository/hawkbit-repository-jpa-flyway/pom.xml | Switches to spring-boot-starter-flyway. |
| hawkbit-repository/hawkbit-repository-jpa-eclipselink/src/main/java/org/eclipse/hawkbit/repository/jpa/* | Boot package moves; doc tweaks; JSpecify NonNull migration. |
| hawkbit-repository/hawkbit-repository-jpa-eclipselink/pom.xml | Adds explicit EclipseLink dep and switches to hibernate-processor. |
| hawkbit-repository/hawkbit-repository-jpa-api/pom.xml | Removes Hibernate exclusion from JPA starter. |
| hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/event/* | Migrates Jackson message conversion to Jackson 3, adds subtype registration configuration. |
| hawkbit-repository/hawkbit-repository-core/src/test/java/org/eclipse/hawkbit/event/* | Updates message converter tests to new configuration/injection. |
| hawkbit-repository/hawkbit-repository-core/pom.xml | Dependency reorder/cleanup (stream-rabbit kept). |
| hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/event/remote/* | Makes event fields compatible with Jackson 3 (final handling, Lombok force ctor, JsonIgnore). |
| hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/DeploymentManagement.java | Switches @Nullable to JSpecify. |
| hawkbit-repository/hawkbit-repository-api/pom.xml | Adds spring-data-commons dependency (removes explicit jackson-annotations). |
| hawkbit-ql-jpa/src/main/java/org/eclipse/hawkbit/ql/jpa/utils/HibernateUtils.java | Updates Hibernate internal APIs used for SQL rendering. |
| hawkbit-ql-jpa/src/test/java/org/eclipse/hawkbit/ql/jpa/SpecificationBuilderTest.java | Updates @DataJpaTest package and removes Flyway exclusion. |
| hawkbit-ql-jpa/pom.xml | Adds JPA test starter and adjusts dependency ordering. |
| hawkbit-monolith/hawkbit-update-server/src/test/java/org/eclipse/hawkbit/app/CorsTest.java | Adapts CORS test expectations for Boot 4 behavior. |
| hawkbit-monolith/hawkbit-update-server/src/main/java/org/eclipse/hawkbit/app/ErrorController.java | Updates Boot error controller packages (WebProperties, webmvc error). |
| hawkbit-monolith/hawkbit-update-server/pom.xml | Adds SpringDoc UI and switches to security test starter. |
| hawkbit-mgmt/hawkbit-mgmt-starter/src/main/java/.../MgmtSecurityConfiguration.java | Updates filter-chain method signature and exception declaration. |
| hawkbit-mgmt/hawkbit-mgmt-starter/pom.xml | Switches to spring-boot-starter-webmvc. |
| hawkbit-mgmt/hawkbit-mgmt-server/src/test/java/.../CorsTest.java | Adapts CORS test expectations for Boot 4 behavior. |
| hawkbit-mgmt/hawkbit-mgmt-server/src/main/java/.../ErrorController.java | Updates Boot error controller packages (WebProperties, webmvc error). |
| hawkbit-mgmt/hawkbit-mgmt-server/pom.xml | Adds SpringDoc UI starter. |
| hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/.../MgmtTargetTypeResourceTest.java | Updates request expectations and documents converter behavior. |
| hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/.../MgmtTargetResourceTest.java | Updates Boot JpaProperties package and consolidates ObjectMapper usage. |
| hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/.../MgmtBasicAuthResourceTest.java | Updates @AutoConfigureMockMvc package for Boot 4. |
| hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/.../MgmtApiConfiguration.java | Implements WebMvcConfigurer marker interface. |
| hawkbit-mgmt/hawkbit-mgmt-resource/pom.xml | Adds spring-boot-starter-webmvc-test. |
| hawkbit-mgmt/hawkbit-mgmt-api/src/test/java/.../MgmtTargetAssignmentResponseBodyTest.java | Formatting cleanup. |
| hawkbit-mgmt/hawkbit-mgmt-api/src/main/java/.../MgmtDistributionSetAssignment.java | Adds no-args ctor for JSON binding. |
| hawkbit-mgmt/hawkbit-mgmt-api/pom.xml | Adds HATEOAS test starter. |
| hawkbit-mcp/hawkbit-mcp-server/src/main/java/.../McpServerStart.java | Updates Boot security auto-config exclude package. |
| hawkbit-dmf/hawkbit-dmf-server/pom.xml | Removes unnecessary servlet-api dependency. |
| hawkbit-dmf/hawkbit-dmf-rabbitmq-test/pom.xml | Cleans up dependency scopes and removes spring-rabbit-test. |
| hawkbit-dmf/hawkbit-dmf-api/lombok.config | Disables nullability annotations for this module. |
| hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/.../DmfApiConfiguration.java | Migrates to core retry + JacksonJsonMessageConverter with JsonMapper injection. |
| hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/.../AmqpMessageDispatcherService.java | Minor time-call cleanup. |
| hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/.../AmqpMessageHandlerServiceTest.java | Switches to JacksonJsonMessageConverter. |
| hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/.../AmqpMessageHandlerServiceIntegrationTest.java | Formatting cleanup. |
| hawkbit-dmf/hawkbit-dmf-amqp/pom.xml | Switches to spring-boot-starter-amqp. |
| hawkbit-ddi/hawkbit-ddi-starter/src/main/java/.../ControllerDownloadSecurityConfiguration.java | Updates filter-chain method signature and exception declaration. |
| hawkbit-ddi/hawkbit-ddi-starter/pom.xml | Switches to spring-boot-starter-webmvc. |
| hawkbit-ddi/hawkbit-ddi-server/pom.xml | Adds SpringDoc UI starter. |
| hawkbit-ddi/hawkbit-ddi-resource/pom.xml | Switches CBOR Jackson group to tools.jackson.* and adds webmvc test starter. |
| hawkbit-ddi/hawkbit-ddi-api/src/main/java/.../DdiActivateAutoConfirmation.java | Switches @Nullable to JSpecify. |
| hawkbit-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports | Adds hawkBit auto-configuration entry. |
| hawkbit-core/src/main/resources/hawkbit-jackson-defaults.properties | Adds Jackson defaults for final-field mutators + single-value-as-array behavior. |
| hawkbit-core/src/main/java/org/eclipse/hawkbit/tenancy/TenantAwareCacheManager.java | Switches @Nullable to JSpecify. |
| hawkbit-core/src/main/java/org/eclipse/hawkbit/tenancy/DefaultTenantConfiguration.java | Updates Boot package moves and observation filter wiring. |
| hawkbit-core/src/main/java/org/eclipse/hawkbit/HawkbitAutoConfiguration.java | New base auto-config to apply hawkBit Jackson defaults. |
| hawkbit-core/src/main/java/org/eclipse/hawkbit/context/AccessContext.java | Migrates to tools.jackson ObjectMapper and simplifies serialization logic. |
| hawkbit-core/src/main/java/org/eclipse/hawkbit/auth/StaticAuthenticationProvider.java | Updates Boot SecurityProperties package. |
| hawkbit-core/pom.xml | Replaces individual deps with Boot starters and adds Jackson 3 databind. |
| hawkbit-autoconfigure/src/main/java/.../StaticUserManagementAutoConfiguration.java | Updates Boot SecurityProperties package. |
| hawkbit-autoconfigure/src/main/java/.../SecurityAutoConfiguration.java | Updates Boot SecurityProperties package. |
| hawkbit-autoconfigure/pom.xml | Removes provided servlet-api dependency. |
| hawkbit-artifact/hawkbit-artifact-fs/src/test/java/.../FileArtifactStorageTest.java | Removes commons-io usage; adds custom recursive delete. |
| hawkbit-artifact/hawkbit-artifact-fs/src/main/java/.../FileArtifactStorage.java | Removes commons-io; adds custom silent delete implementation. |
| hawkbit-artifact/hawkbit-artifact-fs/pom.xml | Removes now-unneeded dependencies (spring-core/autoconfigure/commons-io). |
| hawkbit-artifact/hawkbit-artifact-api/pom.xml | Removes now-unneeded direct Spring/Jakarta/test deps (relying on hawkbit-core). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_20_1__spring_boot_4__POSTGRESQL.sql
Show resolved
Hide resolved
...epository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_20_1__spring_boot_4__MYSQL.sql
Show resolved
Hide resolved
...kbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_20_1__spring_boot_4__H2.sql
Show resolved
Hide resolved
hawkbit-monolith/hawkbit-update-server/src/test/java/org/eclipse/hawkbit/app/CorsTest.java
Show resolved
Hide resolved
...epository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/repository/ACMRepository.java
Show resolved
Hide resolved
...y-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/HawkbitBaseRepositoryFactoryBean.java
Show resolved
Hide resolved
...esource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTypeResourceTest.java
Show resolved
Hide resolved
hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitClient.java
Show resolved
Hide resolved
7cc695f to
41ef377
Compare
Notes: 1. (!) Eclipselink shall be migrated to 5.0 (in 4.0.8 there are incompatible classes, e.g EJBQueryImpl doesn't implement some newer methods). In the moment is with beta (5.0.0-B12) - JUST for testing! 2. (!) Ethlo plugin doesn't work with Eclipselink 5.0, it builds with Eclipselink 4.0.8 (could be a problem) 3. Dependencies - new starters, test starters changes, some dependencies refactoring 4. Auto-configs split - package changes, some properties classes changes 5. Spring nullable org.springframework.lang.Nullable/NonNull are depecated and replaced with jspcify -> org.jspecify.annotations.Nullable/NonNull (NullMarked) 6. Lombok config - adding lombok.addNullAnnotations=jspecify - to do not mess annotations 7. Distributed lock table changes - SP_LOCK table db migration 8. Spring Retry replaced with Spring Core Retry - does repace retry in hawkbit 9. Specifications -> added Update/Delete(/Predicate) Specifications and JpaSpecificationExecutor changed 10. HawkbitBaseRepositoryFactoryBean modified to register properly 11. Jackson - 2 -> 3, package migrations, finals are not deserialized by default(enable finals deserialization, consider make non-final), too ‘smart’ tries to set complex objects instead of using non args constructor (-> @JsonIgnore), some other default configs made Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
| @@ -0,0 +1 @@ | |||
| ALTER TABLE SP_LOCK ADD COLUMN EXPIRED_AFTER TIMESTAMP NOT NULL; No newline at end of file | |||
There was a problem hiding this comment.
Wouldn't this fail in cases where SP_LOCK has some rows in it ?
DB would try to populate every existing row with that column and its value, but since there is NOT NULL and no default is specified wouldn't that query fail ?
There was a problem hiding this comment.
SP_LOCK table is used by spring database lock and we strictly follow the spring table definition.
Probably spring lock has set timestamp if the column has existed. If there are nulls - db cleanup may be needed.
it is possible to add table cleanup before - but not sure about concurrency - it will unlock table eventually ot
|
|
||
| hawkbit.repository.cluster.lock.ttl=3000 | ||
| hawkbit.repository.cluster.lock.refreshOnRemainMS=2000 | ||
| hawkbit.repository.cluster.lock.ttl=1000 |
There was a problem hiding this comment.
Is there a reason to revert those ?
There was a problem hiding this comment.
test faild with the 3000/2000 config when build by verify github actions. Also use to always fail localy.
So I returned it back to previous config - with that it works
hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/DmfApiConfiguration.java
Show resolved
Hide resolved
|
|
||
| /** | ||
| * @see Retryable#maxAttempts() | ||
| * See {@link Retryable#maxRetries()} |
There was a problem hiding this comment.
Are we aware that attempt != retry ?
old way assumes 10 attempts, but the new approach adds 10 retries to an attempt = 11 ? Just to double check.
There was a problem hiding this comment.
I suppose that the number is just a "guess" or something random. and 10 is as good as 11
| retryTemplate = new RetryTemplate(RetryPolicy.builder() | ||
| .includes(ConcurrencyFailureException.class) | ||
| .maxRetries(maxRetries) | ||
| .maxDelay(Duration.ofMillis(delay)) |
There was a problem hiding this comment.
The old approach used
backOffPolicy.setBackOffPeriod(Constants.TX_RT_DELAY);
This was the initial delay right ? Current max Delay seems different in semanthics ?
Maybe we could add .delay() into the builder with some configured value ?
There was a problem hiding this comment.
Good point. Actually the old approach was with backoff new is with delay - an attempt timeout ..
not sure what is the proper way to configure..
There was a problem hiding this comment.
from https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/backoff/FixedBackOff.html it seems that Fixed backoff is delay between attempts which probably is the same as now - delay beteewn attempts



Notes: