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

8th
Jul 2018
dragontree101
@dragontree101
Jul 08 2018 00:47
i found metadata must in one instance, i want to config some global metadata in eureka, how can i put some metadata detach from instance instead of global
only restful api PUT /eureka/v2/apps/appID/instanceID/metadata?key=value
must in appID and instanceID, i want to pus some key:value in global, how can i do? thanks
Zakaria Amine
@zak905
Jul 08 2018 15:21
hello
based on the spring cloud guides for registration and discovery https://spring.io/guides/gs/service-registration-and-discovery/, the convention is that the Eureka registry should be on port 8761 right?
how about launching the server with another port? how would the client find it?
Patrick Cornelißen
@pcornelissen
Jul 08 2018 17:22
Hi! I'm working on a little example project and I'm using the HystrixCommand class and not Javanica. When I use the hystrix dashboard (doesn't matter whether I use turbine in between or if I go directly on the services hystrix stream), I can see that the command appears in the UI, but no calls are counted/visualized. I checked the stream and all values remain at 0. I'm puzzled I never had this before. Does someone have an idea why that may be the case? The command is pretty straight forward and I'm pretty sure that I have used it in this way before :-/
        new HystrixCommand<Void>(
                HystrixCommand.Setter
                        .withGroupKey(HystrixCommandGroupKey.Factory.asKey("ratings"))
                        .andCommandKey(HystrixCommandKey.Factory.asKey("removeRatings"))
        ) {
            @Override
            protected Void run() throws Exception {
                log.info("DELETE! {}", id);
                restTemplate.exchange(entity, Void.class);
                return null;
            }

            @Override
            protected Void getFallback() {
               ...
            }
        }.run();
Patrick Cornelißen
@pcornelissen
Jul 08 2018 17:48
Aaaargh, ok... run() is not a good idea, execute() would have been the right method...
Spencer Gibb
@spencergibb
Jul 08 2018 18:41
@zak905 you just need to put the full url in the eureka client
Zakaria Amine
@zak905
Jul 08 2018 18:44
in other words, I have to configure the client myself rather than let spring do it
spring.cloud.discovery.client.simple.uri should do it
thanks @spencergibb I am gonna try
Spencer Gibb
@spencergibb
Jul 08 2018 18:59
@zak905 it only defaults to localhost:8761 which should never be used in production anyway.
simple.uri is not for eureka
Zakaria Amine
@zak905
Jul 08 2018 20:10
@spencergibb do you have any example code snippet ?