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

21st
Nov 2017
Artem
@Art-T
Nov 21 2017 07:12
Hi could someone provide correct erd for spring cloud task? Those used in documentation isn’t correct. Thanks
Dave Syer
@dsyer
Nov 21 2017 08:39
What's an "erd"?
Which documentation do you mean?
Premanand Chandrasekaran
@premanandc
Nov 21 2017 09:09

Hello all, I have a zuul-based API gateway and am looking for the equivalent of the config below:

zuul:
  routes:
    greet:
      path: /greet/**
      serviceId: greeting-service

either programmatically in Java config or in application.(properties|yml)
The greeting-service is the serviceId from a netflix eureka discovery service. Can one of you kindly point me in the right direction please?

Dave Syer
@dsyer
Nov 21 2017 09:24
Eh?
Isn't that aready YAML?
Premanand Chandrasekaran
@premanandc
Nov 21 2017 09:30
You mean the zuul snippet above? Yes it is
I mean the yaml snippet is what I use in a zuul based api gateway. Looking for the spring cloud gateway equivalent
Dave Syer
@dsyer
Nov 21 2017 09:33
Ah. You didn't say that.
Premanand Chandrasekaran
@premanandc
Nov 21 2017 09:33
Apologies. I wasn’t clear at all
I’m using spring-cloud-dependencies version Finchley.M4 which brings in spring-cloud-starter-gateway version 2.0.0.M4
Dave Syer
@dsyer
Nov 21 2017 09:36
I know there's a LoadBalancerClientFilter
I imagine that's what you need

From the user guide:

If the url has a lb scheme (ie lb://myservice), it will use the Spring Cloud LoadBalancerClient to resolve the name (myservice in the previous example) to an actual host and port and replace the URI in the same attribute.

Dave Syer
@dsyer
Nov 21 2017 09:38
Yes
I guess that means
spring:
  cloud:
    gateway:
      routes:
      - id: greeting
        uri: lb://greeting-service
        predicates:
        - Path=/greeting/**
(I'm guessing)
@spencergibb will be around later. We should have an example in the user guide.
Premanand Chandrasekaran
@premanandc
Nov 21 2017 09:44
Thanks! I need to read more of the docs and code. Just started looking at this
Just FYI, trying to gauge what difference zuul vs cloud gateway makes. We have spring-cloud + zuul running in prod
Artem
@Art-T
Nov 21 2017 09:57
@dsyer erd - Entity Relationship Diagram documentation
Artem
@Art-T
Nov 21 2017 10:12
@shakuzen sure. I need to create these tables manually.
Premanand Chandrasekaran
@premanandc
Nov 21 2017 10:44

@dsyer I tried what you suggested and also the Java config version like below:

  @Bean
  public RouteLocator customRoutes() {
    return Routes.locator()
        .route("greeting")
        .predicate(path("/greet/**"))
        .uri(“lb://greeting-service")
        .build();
  }

When I look at the routes actuator endpoint, the predicate seems to go missing:

{
  "routes": [
    {
      "id": "greeting",
      "uri": "lb://greeting-service",
      "order": 0,
      "predicate": {

      },
      "filters": [
        {
          "order": 1
        }
      ]
    }
  ],
  "routeDefinitions": [
    {
      "id": "greeting",
      "predicates": [
        {
          "name": "Path",
          "args": {
            "_genkey_0": "/greet/**"
          }
        }
      ],
      "filters": [

      ],
      "uri": "lb://greeting-service",
      "order": 0
    }
  ]
}

And it doesn’t work as expected

Dave Syer
@dsyer
Nov 21 2017 10:53
Dunno. I guess we should wait for @spencergibb
Premanand Chandrasekaran
@premanandc
Nov 21 2017 10:53
OK
Raja Sundaram
@zeagord
Nov 21 2017 11:04
There is a DiscoveryClientRouteDefinitionLocator, I was referring that and implement as well.
Maybe you can check that
Artem
@Art-T
Nov 21 2017 12:18
if someone else will needed DDL for TaskRepository just use sql files from source code. Thanks
nithinc989
@nithinc989
Nov 21 2017 13:07
Can anyone Guide me deploy a boot service with authentication for consul health check ?
Spencer Gibb
@spencergibb
Nov 21 2017 16:05
@premanandc there's an open issue about the routes actuator endpoint, that shouldn't mean it doesn't work