xxxxxxxxxx
public Mono<Product> getProduct(int productId) {
if (productId < 1) {
throw new InvalidInputException("Invalid productId: " + productId);
}
return repository.findByProductId(productId)
.switchIfEmpty(Mono.error(new NotFoundException("No product found
for productId: " + productId)))
.log(LOG.getName(), FINE)
.map(e -> mapper.entityToApi(e))
.map(e -> setServiceAddress(e));
}