-
Title: Regression in Describe the bugWhen using This behavior does not occur in version 23.2.2, where the downstream URL is correctly constructed using the registered service address. To Reproduce
Expected behaviorOcelot should construct the downstream URL using the address and port of the service instance registered in Consul (i.e., from Actual behaviorThe downstream URL is constructed using the node address ( Version details
Additional contextThis looks like a regression introduced after 23.2.2. Possibly related to a change in how service discovery entries are parsed or selected. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 1 reply
-
I don't think so!
Finally, I would say that version 13.5.2 introduced a "regression" where the node name takes precedence over the agent address. Ocelot/src/Ocelot.Provider.Consul/DefaultConsulServiceBuilder.cs Lines 76 to 77 in 0b794b3 Note: If you want to disable the "node name" feature entirely, simply refrain from defining both the entry node and nodes. After that, the service agent address will be used. If it is impossible to remove node definitions from the Consul configuration, you must override this method to always return a null result, like this: protected override Node GetNode(ServiceEntry entry, Node[] nodes) => null; After that, the following method will always select and return the agent address, as the node name will always be null: Ocelot/src/Ocelot.Provider.Consul/DefaultConsulServiceBuilder.cs Lines 96 to 97 in 0b794b3 Or simply override the GetDownstreamHost method following the documentation.
|
Beta Was this translation helpful? Give feedback.
-
In my opinion, there is no bug; the issue lies in differing DevOps strategies.
I expect some debate here... Could you attach the Consul configuration as plain text or a JSON file so we can continue analyzing the changes in the migration from 23.2.2 to 23.3.0? |
Beta Was this translation helpful? Give feedback.
-
I guess a real Ocelot config (aka "ocelot.json") and real Consul config will help to "repro" your scenario. |
Beta Was this translation helpful? Give feedback.
-
It has already been implemented, mister!
Yes, because you define nodes. |
Beta Was this translation helpful? Give feedback.
-
No, No ❗ |
Beta Was this translation helpful? Give feedback.
-
It looks like you don't read →
Yes, parsing and retrieving Consul data have been slightly modified, incorporating it into the DefaultConsulServiceBuilder and Consul classes. However, while parsing has changed, the overall functionality remains the same. You need to understand the current implementation of the default service builder and leverage its flexible functionality, which supports overrides and customizations. |
Beta Was this translation helpful? Give feedback.
-
Hey, |
Beta Was this translation helpful? Give feedback.
I don't think so!
Have you read official documentation sections? →
Consul Service Builder explains the evolution of the feature and the DevOps challenges that may arise.
The quote:
To have a control over this longstanding Consul config & DevOps issues, version 23.3 introduced a customization feature that allows control o…