Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public class FinancialDataService {
@Value("${MOODYS_API_KEY:demo_moodys_key}")
private String moodysApiKey;

@Value("${MOODYS_API_URL:https://api.ratings.moodys.com/research/v1/ratings?identifier=test}")
private String moodysApiUrl;

private HttpClient httpClient;

@PostConstruct
Expand Down Expand Up @@ -92,7 +95,7 @@ private CompletableFuture<Void> fetchExchangeRates() {

private CompletableFuture<Void> fetchMoodysRating() {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.ratings.moodys.com/research/v1/ratings?identifier=test"))
.uri(URI.create(moodysApiUrl))
.timeout(TIMEOUT)
.header("Authorization", "Bearer " + moodysApiKey)
.GET()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ public class RouterValidator {

public static final List<String> openApiEndpoints = List.of(
"/api/users/register",
"/api/users/login"
"/api/users/login",
"/api/users/check-username",
"/api/users/check-email"
);

public Predicate<ServerHttpRequest> requiresAuthentication =
Expand Down
5 changes: 5 additions & 0 deletions kubernetes/base/configmaps/app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ data:
NOTIFICATION_SERVICE_URL: "http://banking-notification:80"
KAFKA_BROKERS: "banking-kafka:9092"

# Third-party API overrides (reachable defaults for demo capture)
SLACK_WEBHOOK_URL: "https://httpbin.org/anything/slack/webhook"
MOODYS_API_URL: "https://httpbin.org/anything/moodys/ratings?identifier=test"

# Observability (language-agnostic OTel)
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.observability:4317"
OTEL_EXPORTER_OTLP_PROTOCOL: "grpc"
Expand Down Expand Up @@ -96,6 +100,7 @@ data:
DB_SCHEMA: "transactions_service"
SERVER_PORT: "8080"
SPRING_PROFILES_ACTIVE: "docker"
ERROR_SPIKE_ENABLED: "false"
MANAGEMENT_TRACING_ENABLED: "true"
MANAGEMENT_ENDPOINT_HEALTH_PROBES_ENABLED: "true"
MANAGEMENT_TRACING_SAMPLING_PROBABILITY: "1.0"
Expand Down
7 changes: 3 additions & 4 deletions kubernetes/base/deployments/accounts-service-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
name: banking-jwt-secret
key: secret
- name: JAVA_OPTS
value: "-Xms64m -Xmx128m -XX:MaxMetaspaceSize=128m -XX:ReservedCodeCacheSize=32m -XX:MaxDirectMemorySize=16m -XX:+UseSerialGC -XX:+UseStringDeduplication -XX:+UseContainerSupport -Djava.security.egd=file:/dev/./urandom -Dspring.main.lazy-initialization=true"
value: "-Xms128m -Xmx384m -XX:MaxMetaspaceSize=128m -XX:ReservedCodeCacheSize=32m -XX:MaxDirectMemorySize=16m -XX:+UseSerialGC -XX:+UseStringDeduplication -XX:+UseContainerSupport -Djava.security.egd=file:/dev/./urandom -Dspring.main.lazy-initialization=true"
- name: AWS_S3_BUCKET
value: "banking-app-statements"
- name: AWS_REGION
Expand All @@ -60,11 +60,10 @@ spec:
name: banking-accounts-config
resources:
requests:
memory: "256Mi"
memory: "384Mi"
cpu: "50m"
limits:
memory: "512Mi"
# Right-sized for live sim traffic; 150m throttled the JVM (see user-service).
memory: "1Gi"
cpu: "1000m"
startupProbe:
tcpSocket:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ spec:
name: banking-jwt-secret
key: secret
- name: JAVA_OPTS
value: "-Xms64m -Xmx128m -XX:MaxMetaspaceSize=128m -XX:ReservedCodeCacheSize=32m -XX:MaxDirectMemorySize=16m -XX:+UseSerialGC -XX:+UseStringDeduplication -XX:+UseContainerSupport -Djava.security.egd=file:/dev/./urandom -Dspring.main.lazy-initialization=true"
value: "-Xms128m -Xmx384m -XX:MaxMetaspaceSize=128m -XX:ReservedCodeCacheSize=32m -XX:MaxDirectMemorySize=16m -XX:+UseSerialGC -XX:+UseStringDeduplication -XX:+UseContainerSupport -Djava.security.egd=file:/dev/./urandom -Dspring.main.lazy-initialization=true"
envFrom:
- configMapRef:
name: app-config
- configMapRef:
name: banking-transactions-config
resources:
requests:
memory: "256Mi"
memory: "384Mi"
cpu: "50m"
limits:
memory: "512Mi"
memory: "1Gi"
# Right-sized for live sim traffic; 150m throttled the JVM (see user-service).
cpu: "1000m"
startupProbe:
Expand Down
1 change: 1 addition & 0 deletions kubernetes/overlays/speedscale/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kind: Kustomization
resources:
- ../../base
- ../../observability
- speedscale-metrics-services.yaml

patches:
# Add Istio injection and Speedscale labels to the existing banking-app namespace
Expand Down
34 changes: 34 additions & 0 deletions kubernetes/overlays/speedscale/speedscale-metrics-services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: v1
kind: Service
metadata:
name: speedscale-forwarder-metrics
namespace: speedscale
labels:
app.kubernetes.io/name: speedscale
app.kubernetes.io/component: forwarder-metrics
spec:
selector:
app: speedscale-forwarder
controlplane.speedscale.com/component: forwarder
ports:
- port: 4145
targetPort: 4145
protocol: TCP
name: metrics
---
apiVersion: v1
kind: Service
metadata:
name: speedscale-nettap-metrics
namespace: speedscale
labels:
app.kubernetes.io/name: speedscale
app.kubernetes.io/component: nettap-metrics
spec:
selector:
app: speedscale-nettap
ports:
- port: 4145
targetPort: 4145
protocol: TCP
name: metrics
12 changes: 6 additions & 6 deletions simulation-client/src/client/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,10 @@ class ApiClient {
}

// Transaction endpoints
// The frontend BFF route is POST /api/transactions (it proxies to the
// backend's /api/transactions/create). transactions-service requires a
// currency, so default it here.
async createTransaction(transactionData, token) {
const payload = { currency: 'USD', ...transactionData };
return this.retryRequest(async () => {
const response = await this.client.post('/api/transactions', payload, {
const response = await this.client.post('/api/transactions/create', payload, {
headers: { Authorization: `Bearer ${token}` }
});
return response.data;
Expand All @@ -185,11 +182,14 @@ class ApiClient {
}

async getTransaction(transactionId, token) {
// No GET /{id} endpoint on transactions-service; use the list endpoint
// and filter client-side. Return null if not found.
return this.retryRequest(async () => {
const response = await this.client.get(`/api/transactions/${transactionId}`, {
const response = await this.client.get('/api/transactions', {
headers: { Authorization: `Bearer ${token}` }
});
return response.data;
const txns = Array.isArray(response.data) ? response.data : response.data?.content || [];
return txns.find(t => t.id === transactionId) || null;
});
}

Expand Down
Loading