Package com.dani.bff.gateway
Class ResilientDashboardGateway
java.lang.Object
com.dani.bff.gateway.ResilientDashboardGateway
Applies circuit-breaker policies and fallback behavior around dashboard downstream calls.
-
Constructor Summary
ConstructorsConstructorDescriptionResilientDashboardGateway(UserServiceClient userServiceClient, ProductServiceClient productServiceClient) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<List<ProductRecommendation>> getRecommendedProducts(String userId) Reads recommendations with an empty-list fallback.reactor.core.publisher.Mono<UserProfile> getUserProfile(String userId) Reads the user's profile with a safe placeholder fallback.
-
Constructor Details
-
ResilientDashboardGateway
public ResilientDashboardGateway(UserServiceClient userServiceClient, ProductServiceClient productServiceClient)
-
-
Method Details
-
getUserProfile
@CircuitBreaker(name="userService", fallbackMethod="fallbackUserProfile") public reactor.core.publisher.Mono<UserProfile> getUserProfile(String userId) Reads the user's profile with a safe placeholder fallback.- Parameters:
userId- authenticated user identifier- Returns:
- profile from the user service or a placeholder when unavailable
-
getRecommendedProducts
@CircuitBreaker(name="productService", fallbackMethod="fallbackRecommendedProducts") public reactor.core.publisher.Mono<List<ProductRecommendation>> getRecommendedProducts(String userId) Reads recommendations with an empty-list fallback.- Parameters:
userId- authenticated user identifier- Returns:
- recommendations from the product service or an empty list when unavailable
-