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

20th
Apr 2017
softmanu
@softmanu
Apr 20 2017 08:04
what is the default isolation level in Camden.SR3 release.? is it Thread or Semaphore..? it's bit confusing a bit now after going through many posts/blogs. as some say it's Thread and some day it's Semaphore..
Dave Syer
@dsyer
Apr 20 2017 08:05
It probably depends on the context
If you use hystrix or javanica directly we would never change anything
softmanu
@softmanu
Apr 20 2017 08:07
we are using Hystrix only.. so in this case will it be Semaphore as the default isolation level.?
Dave Syer
@dsyer
Apr 20 2017 08:08
If that's the default in the library (I believe so)
softmanu
@softmanu
Apr 20 2017 08:08
fine..thanks we will check back..

and the other query is ::
zuul.semaphore.max-semaphores: 2000

hystrix:
command:
default:
execution:
isolation:
semaphore:
maxConcurrentRequests: 200

Are these above two property applicable only for Semaphore or Thread or for both the isolation levels.?

Dave Syer
@dsyer
Apr 20 2017 08:11
Please format your code
I can't read the YAML
(It's a netflix question not a spring question though, so you can probably answer it as well as I can)
softmanu
@softmanu
Apr 20 2017 08:12
hystrix.command.default.isolation.semaphore.max-concurrent-requests=200
Dave Syer
@dsyer
Apr 20 2017 08:13
Why would that apply to thread isolation? How would it?
Amin Abu-Taleb
@aabutaleb
Apr 20 2017 10:06
Hi guys, I don't know if this is doable but, is it possible to reach service endpoints running on the management port (like /env or /info or /trace) through zuul?
Dave Syer
@dsyer
Apr 20 2017 10:16
Did you try it?
They are just endpoints. Nothing blocks them unless you do.
Amin Abu-Taleb
@aabutaleb
Apr 20 2017 10:32
sure I did, the port prevents me from reaching the service. If I specify, let's say, port 4444, it would be http://gateway:4444/env. Zuul understands his own /env endpoint on his own 4444 port
If I don't add that management port, zuul tries to reach /env on the default service port (lack of a better term) instead of the management port
Dave Syer
@dsyer
Apr 20 2017 10:41
Then you have to register them under the new port I guess
Is it via an explicit route mapping, or service discovery?
Amin Abu-Taleb
@aabutaleb
Apr 20 2017 10:44
I know that eureka registers both, the service port and the management port, I would've expected zuul to be able to use that info to reach those endpoints
It's using service discovery
Dave Syer
@dsyer
Apr 20 2017 10:45
I guess it doesn't. Eureka only registers the info and health endpoints. It's kind of a special case.
Open a new issue in s-c-netflix and we can discuss it there
Amin Abu-Taleb
@aabutaleb
Apr 20 2017 10:46
sure, thanks
Niklas Herder
@herder
Apr 20 2017 10:55

Hi, not sure where to ask this, but I'll try here since a lot of bright people hang out here:
I'm working on integrating Infinispan on AWS with the Infinispan Boot starter + the AWS Ping discovery protocol by Meltmedia. That protocol uses AWS EC2:DescribeInstances to find cluster members by matching against instance tags, but this breaks down when I have a lot of instances, since I get throttling errors from AWS when the protocol queries the API too hard.

So, on to my question: would it be worthwhile to try and create a new protocol which uses the DiscoveryClient in Spring Cloud and match instances against their metadata instead? I think it could be a good way to get the initial hosts for the cluster, and it would integrate nicely with the overall Boot infrastructure.
Any thoughts? Is this a crap idea, or would it be worth trying out?

Dave Syer
@dsyer
Apr 20 2017 10:57
A DiscoveryClientsounds like the right abstraction
I can't comment on the rest
If the "AWS Ping" is a common technique I guess it would make sense if it had its own discovery client
But I have no idea what the demand for that would be. Or how it would solve your throttling problem#
Niklas Herder
@herder
Apr 20 2017 10:59
Sorry, I think I phrased it poorly: I was thinking if I maybe could skip the AWS Ping method and use Eureka or something like that for discovery
Dave Syer
@dsyer
Apr 20 2017 10:59
You certainly could.
Niklas Herder
@herder
Apr 20 2017 11:00
But I'm not super-fluent in JGroups, so I'd just like some input on whether I'm missing something obvious :)
Dave Syer
@dsyer
Apr 20 2017 11:00
JGroups and DiscoveryClient are not interchangeable (obviously)
Niklas Herder
@herder
Apr 20 2017 11:01
No, I'd just use it for the initial hosts, then let JGroups do its thing
Maybe an idea to try out for our upcoming company Hackday, I guess
Federico Ferreyra
@Fedeferreyra
Apr 20 2017 14:20
Hi, I wanted to ask some questions about spring cloud config with vault backend.
From my understanding, what Spring proposes to store the properties in Vault is having a generic path like secret/application and a specific path for each app defined by the spring.application.name property. But when investigating some things about Vault, they recommend to not handle a lot of properties in one folder. Instead, create different folders for each group of properties, like: secret/application/dbconnections. Is there any way to let spring go and search properties that way?
David Steiman
@xetys
Apr 20 2017 14:36
hey, I have an issue with feign clients parameter encoder...currently I am passing a @RequestParam with
String condition = "ModifyDate gt @2017-04-20T09:30:00@ or CreateDate gt @2017-04-20T09:30:00@";
when the request gets out, I get where=ModifyDate+gt+%402017-04-20T09%3A30%3A00%40+or+CreateDate+gt+%402017-04-20T09%3A30%3A00%40
and this brakes the call
Daniel Lavoie
@daniellavoie
Apr 20 2017 14:38
@xetys watch out for injection. What is exactly your problem ? That the special characters aren't decoded ?
David Steiman
@xetys
Apr 20 2017 14:39
its encoded in a "wrong way"
if I do the call in the browser, that string looks like this: ModifyDate%20gt%20@2017-04-20T09:30:00@%20or%20CreateDate%20gt%20@2017-04-20T09:30:00@
and this gets correctly parsed by the underlying api
the code is quite simple
Daniel Lavoie
@daniellavoie
Apr 20 2017 14:40
I get it now
David Steiman
@xetys
Apr 20 2017 14:40
    @RequestMapping(
            method = RequestMethod.GET,
            value = "/accounts"
    )
    AccountWrapper getAccountsWithCondition(@RequestParam("where") String where);
and i actually passed different kinds of that string through where
any ideas?
Daniel Lavoie
@daniellavoie
Apr 20 2017 14:41
I don't have a quick answer about feign's decoding behavior. Not sure if it is drived by Spring Cloud or directly handled by Feign.
Have you though about passing thoses API criterias through the request body ? Would feel more robust to me.
David Steiman
@xetys
Apr 20 2017 14:43
its sage...
Daniel Lavoie
@daniellavoie
Apr 20 2017 14:44
Using the request body you are less likely to encounter url encoding problems. Specially since you rely on tricky characters.
David Steiman
@xetys
Apr 20 2017 14:44
I have to GET that API in order to pass the where param
with POST its a 415 status code
Daniel Lavoie
@daniellavoie
Apr 20 2017 14:48
OpenFeign/feign#225 seems to match your spacing problem
David Steiman
@xetys
Apr 20 2017 15:18
it this .... urlEncoder
David Steiman
@xetys
Apr 20 2017 15:36
    @Bean(name ="urlInterceptor")
    public RequestInterceptor getUrlInterceptor() {
        return template -> template.queries().forEach(
                (s, strings) -> template.query(true, s, strings)
        );
    }
did the trick