riferrei / srclient

Golang Client for Schema Registry
Apache License 2.0
235 stars 70 forks source link

Retrieve schema registry URL #109

Closed k20human closed 3 months ago

k20human commented 3 months ago

Hi,

How some of our applications and some usecases we don't have access to the URL of the registry and only have access to the registry client.

We need the URL of the registry, so I create a PR to add a getter to retrieve back this URL: https://github.com/riferrei/srclient/pull/108

riferrei commented 3 months ago

Do you mind in detailing a bit more about this need?

Isn't the caller of the SchemaRegistry already aware of the URL, given it needs to provide a parameter to create an instance of it?

What is the use case here? One subsystem creates the instance, and the other consumes and this other requires knowing the URL of the registry?

k20human commented 3 months ago

In our case we have a New function that initialize all our dependencies of a component (a struct). This component has a registry client inside the struct.

Inside the New function we retrieve some configuration parameters like the schema registry URL. But we don't keep all our configuration parameters, they are only usefull to init all our dependencies.

But inside our component we sometimes need the URL to change the behavior of a feature. We can of course store the URL inside our struct but we prefer as less properties as possible if we can access it in another way.

I hope it's more clear :)

k20human commented 3 months ago

Thanks for the PR merge 🙏🏻

Is it possible to create a new tag please ?

riferrei commented 3 months ago

Done ✅