Steeltoe icon indicating copy to clipboard operation
Steeltoe copied to clipboard

Port information is not transferred as part of body request

Open thompson-tomo opened this issue 1 year ago • 3 comments

Describe the bug

When a eureka registration is occurring the port number is not being set in the payload however the

Steps to reproduce

Steps to reproduce the behavior:

  1. Define your port information in configuration
Data.Add("eureka:instance:Port", "90");
Data.Add("eureka:instance:NonSecurePortEnabled", true.ToString());
Data.Add("eureka:instance:SecurePortEnabled", false.ToString());
  1. Have an application perform a registration with eureka
  2. Observe payload coming in
  3. Notice port numbers are not set
  4. Observe all other urls are using the port ie info & health address

Expected behavior

The port number number when configured is provided as part of the payload

Environment (please complete the following information):

  • Steeltoe Version 3.2.6
  • OS: Windows,
  • .NET Version Net 8

thompson-tomo avatar May 12 '24 10:05 thompson-tomo

I'm unable to reproduce this with the provided details. Can you try with the FortuneTeller sample at https://github.com/SteeltoeOSS/Samples/blob/main/Discovery/src/FortuneTeller.sln?

bart-vmware avatar May 13 '24 08:05 bart-vmware

Sure will look at that sample tomorrow my time & report back.

thompson-tomo avatar May 13 '24 10:05 thompson-tomo

so i have noticed a couple of things while debugging. The IsUnsecurePortEnabled flag is not being respected for some reason and always showing as false even when config is different. I have tried using the property: IsUnsecurePortEnabled and what the docs stated but it hasn't helped. I have pushed my reproduct6ion up to my eureka branch of the samples

thompson-tomo avatar May 13 '24 23:05 thompson-tomo

The configuration key is named NonSecurePortEnabled, not IsUnsecurePortEnabled (see https://docs.steeltoe.io/api/v3/discovery/netflix-eureka.html).

bart-vmware avatar May 14 '24 06:05 bart-vmware

found the root cause. I was using newtonsoft for my deserialisation rather than system.text.json hence it didn't respect the JsonPropertyName attributes. Hence closing

thompson-tomo avatar May 15 '24 22:05 thompson-tomo