These are chat archives for spring-cloud/spring-cloud

23rd
May 2017
Israel Fernández
@iferca
May 23 2017 01:04
I’m calling for ideas on how to use vavr’s Either<L, R> type as a return type for reactive spring services. I’m trying to figure out how I can response HTTP OK if Either.isRight() with is corresponding value or respond with other HTTP 4XX/5XX if Either.isLeft(). Obviously I can add an if in my controller and then return Mono<T> with whatever left or right I find but I’m looking for a more transparent model where I can avoid asking the questions about left or right in all my endpoints while keeping the code clean. Thanks in advance!
Tommy Ludwig
@shakuzen
May 23 2017 01:07
@iferca Why is that any better than throwing an exception and letting the exception handler deal with exceptional cases and keeping the return value specific to the success case?
(also what does this have to do with Spring Cloud, since you are asking in the Spring Cloud room?)
Israel Fernández
@iferca
May 23 2017 01:12
For the first question: I’ve found that using error values and preventing exceptions from flying (eventually out of control) give me more control, just looking for a nice way to fit in Spring MVC that, as you pointed heavily relay on exceptions to handle errors. Answering the second one: good point, posted in wrong gitter room, is just next to vavr’s one… sorry for that ;)
Tommy Ludwig
@shakuzen
May 23 2017 01:32
No problem - it’s an interesting question
borgato tommaso
@tommasoborgato_twitter
May 23 2017 06:31
@lowzj thank you for your answer!
Ahmad Iqbal Ali
@ahmadiq
May 23 2017 13:53
Hi, I'm trying to use spring-cloud-starter-consul-config in my boot application.
I have a yaml file loaded into a key in consul, however so far i can't understand how that properties file will get loaded in my application.
I have checked i can access key-value from my spring Environment, using spring.cloud.consul.config.format:KEY-VALUE in my bootstrap.yml, but i haven't had the same luck with yaml properties when i use the YAML or FILES setting