Package com.dani.bff.gateway
Class ProductServiceClient
java.lang.Object
com.dani.bff.gateway.ProductServiceClient
HTTP client for the product service recommendation endpoint.
-
Constructor Summary
ConstructorsConstructorDescriptionProductServiceClient(org.springframework.web.reactive.function.client.WebClient webClient, DownstreamProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<List<ProductRecommendation>> fetchRecommendedProducts(String userId) Fetches product recommendations for a user from the product service.
-
Constructor Details
-
ProductServiceClient
public ProductServiceClient(@Qualifier("productServiceWebClient") org.springframework.web.reactive.function.client.WebClient webClient, DownstreamProperties properties)
-
-
Method Details
-
fetchRecommendedProducts
public reactor.core.publisher.Mono<List<ProductRecommendation>> fetchRecommendedProducts(String userId) Fetches product recommendations for a user from the product service.- Parameters:
userId- authenticated user identifier- Returns:
- recommendations supplied by the downstream service
-