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

15th
Nov 2018
Marcos Barbero
@marcosbarbero
Nov 15 2018 11:56
@pradeepkusingh can you check this property? eureka.client.prefer-same-zone-eureka? by default its value is true in which could explain the behaviour you're facing
Anton Fedosov
@acidelk
Nov 15 2018 13:38
Hi. How can i set header with value from json request body?
Spencer Gibb
@spencergibb
Nov 15 2018 14:55
@acidelk can you give us some more context? I assume this is about zuul or gateway?
Anton Fedosov
@acidelk
Nov 15 2018 15:02
@spencergibb i use gateway and i try create global filter for getting one json field and set it in header.
request body: { "userId": "some user id", ...}
Expected headers: X-User-Id: "some user id"
I dont understand how get json field from Flux without blocking, because set headers method in blocking context
pradeepkusingh
@pradeepkusingh
Nov 15 2018 15:12
@marcosbarbero yes, I can see that property is true
eureka.client.prefer-same-zone-eureka: {
value: true
},
let me make it false and retry
Marcos Barbero
@marcosbarbero
Nov 15 2018 15:27
Let me know how it goes
pradeepkusingh
@pradeepkusingh
Nov 15 2018 15:31
Still no luck
I made it false and no impact.
my eureka is in HO/PO/AS/AS and peered
I see AS/AS works fine.. but HO/PO not distributing
all traffic is going to po and in eureka i see all sites apps are registered
means it is not round robin
Marcos Barbero
@marcosbarbero
Nov 15 2018 15:58
Is it false everywhere? I mean in every app/service?
pradeepkusingh
@pradeepkusingh
Nov 15 2018 15:59
yes..
I checked..
after making changes .. I restarted my app/zuul/eureka
all components involved( but not in AS/AS which his part of eureka peering)
only in HO/PO i restarted..
You may need to change that
pradeepkusingh
@pradeepkusingh
Nov 15 2018 16:01
how can I disable it?
some proeprties?
Spencer Gibb
@spencergibb
Nov 15 2018 16:02
what version are you using?
pradeepkusingh
@pradeepkusingh
Nov 15 2018 16:03
one sec.
Spencer Gibb
@spencergibb
Nov 15 2018 16:03
This is also the default rule ZoneAvoidanceRule
pradeepkusingh
@pradeepkusingh
Nov 15 2018 16:04
Finchley.M8
Marcos Barbero
@marcosbarbero
Nov 15 2018 16:04
Can you move from milestone to release version?
pradeepkusingh
@pradeepkusingh
Nov 15 2018 16:04
sure.
Spencer Gibb
@spencergibb
Nov 15 2018 16:17
wow, yeah. We've had three production releases of Finchley.
Finchley.SR2
pradeepkusingh
@pradeepkusingh
Nov 15 2018 17:24
I have applied Finchley.SR2 to my zuul and eureka..still no luck.
Marcos Barbero
@marcosbarbero
Nov 15 2018 17:26
What are the cloud providers?
Can you share the Config properties?
pradeepkusingh
@pradeepkusingh
Nov 15 2018 17:34
We are using Pivotal CF
pradeepkusingh
@pradeepkusingh
Nov 15 2018 17:46
Sorry.. I am pining you properties no URL
ribbon:
ConnectTimeout: 60000
EnableZoneAffinity: false
MaxAutoRetries: 2
i am sharing snippet

eureka:

client:

region: region1
availability-zones:
  region-1: zx11,zx11,zx11,zx11
service-url:
  z911: "https://test1/eureka"
  z611: "https://test2/eureka"  
  z211: "https://test3/eureka"
  z111: "https://test4/eureka"
prefer-same-zone-eureka: false  
I made few typos while masking actual data
like z911 # zx11
please ignore those
eureka.client.preferSameZoneEureka = false
pradeepkusingh
@pradeepkusingh
Nov 15 2018 17:53
ribbon.eureka.approximateZoneFromHostname=false
thats it.. I have only these proeprties specific to eureka and ribbon