Replies: 3 comments 4 replies
-
@Gooseman What's important here is that you don't need to restart ocelot to load the information from the consul KV store. You could, for example, implement your own logic using the consul API, inject routes, modify parameters programmatically or save your configuration at regular intervals. https://github.com/ggnaegi/SwizlyPeasy.Gateway/blob/master/SwizlyPeasy.Consul/KeyValueStore/KeyValueService.cs |
Beta Was this translation helpful? Give feedback.
-
@Gooseman Welcome to Ocelot world! 😉 |
Beta Was this translation helpful? Give feedback.
-
Yes, that is what I was expecting - that the updating of a value in the KV store via the Consul interface would not be destroyed by an instance of Ocelot that uses the corresponding key restarting. If multiple instances use the key and one restarts after a change has been made in Consul, it overwrites the value for wall insurances using that key, losing any changes that were made.
…On Thu, 16 Nov 2023 at 18:09, Raman Maksimchuk ***@***.***> wrote:
I believe Craigus wants to have persistent KV storage with perfect
integrity, right?
—
Reply to this email directly, view it on GitHub
<#1772 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA6QMOFI3YEKJN7FE24UZADYEZJFZAVCNFSM6AAAAAA6ZYGUDGVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TKOJRGIZTQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I've been playing around with Consul. I haven't yet been able to get it to work with load balancing, but it works fine if I'm just routing to a single instance of a service. It works great if I change the location of that service from the host and/or port configured in the ocelot.json.
What I don't understand is why Consul bothers to store the Ocelot route configuration. I can make changes there - adding a new route, for instance - that are then reflected in the running instance of the gateway service. However, if I restart the gateway service the route information is overwritten, so any changes made in Consul are lost. That new route I added is gone. Is the only reason Consul stores the route information so that temporary dynamic changes can be made, or is there some other reason?
Beta Was this translation helpful? Give feedback.
All reactions