Add cloud-2026-upgrade: step-by-step upgrade of the shop to Spring Boot 4.2.0 / Spring Cloud 2026.0.0, with probes
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4HkWoC7hLzk61vZa8
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
diff --git a/order-service/src/main/java/com/ankurm/shop/order/OrderProperties.java b/order-service/src/main/java/com/ankurm/shop/order/OrderProperties.java
|
||||
index 773028b..38e747f 100644
|
||||
--- a/order-service/src/main/java/com/ankurm/shop/order/OrderProperties.java
|
||||
+++ b/order-service/src/main/java/com/ankurm/shop/order/OrderProperties.java
|
||||
@@ -2,7 +2,21 @@ package com.ankurm.shop.order;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
-/** Bound from shop.order.* , which comes from the config server (order-service.yml). */
|
||||
+/**
|
||||
+ * Bound from shop.order.* , which comes from the config server (order-service.yml).
|
||||
+ * A class with setters, not a record: a refresh can only re-bind values into an object it can mutate.
|
||||
+ */
|
||||
@ConfigurationProperties("shop.order")
|
||||
-record OrderProperties(String currency, int maxQuantity) {
|
||||
+class OrderProperties {
|
||||
+ private String currency;
|
||||
+ private int maxQuantity;
|
||||
+
|
||||
+ public void setCurrency(String currency) { this.currency = currency; }
|
||||
+ public void setMaxQuantity(int maxQuantity) { this.maxQuantity = maxQuantity; }
|
||||
+ public String getCurrency() { return currency; }
|
||||
+ public int getMaxQuantity() { return maxQuantity; }
|
||||
+
|
||||
+ // the accessor names the rest of the service already uses
|
||||
+ String currency() { return currency; }
|
||||
+ int maxQuantity() { return maxQuantity; }
|
||||
}
|
||||
Reference in New Issue
Block a user