-
Hello, So first question is, is Stork a framework which can handle this automatically or do I understand the purpose of this framework wrong? If I understand the purpose right, why can't I get this running with Quarkus? Here is an example with DNS which does not work for me https://stackoverflow.com/questions/78316327/quarkus-and-smallrye-stork-cannot-find-dns. (Problem is describe there) Is this the only thing I have to do? https://smallrye.io/smallrye-stork/2.6.0/service-discovery/static-list/#dependency
And this is how I use it in code: With github.com I get HTTP 301, with other URLs I get Bad Request 400 and so on. If I do this (although this probably does not make any sense), the behaviour is different again. For github.com I get 406 not acceptable then.
What do I understand wrong here? Why can't Quarkus resolve the stork-URLs? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
Hi Bevor, Thank you for reaching out. Have you tried with the default dns server? It should be used if you don't configure the dns-servers property. Are you sure the service is running in the 8443 port? For static list service discovery yes, that's correct. The problem with github.com is that Stork is using a default port Here you can check some code: |
Beta Was this translation helpful? Give feedback.
-
Hello, thanks for your answer. I tried with default DNS server, non-default DNS server. The service is running on 8443 and the connection works with default QuarkusRest client without problems. The problem is, that Quarkus Rest client cannot deal with multiple A type entries (if one is not reachable). So I tried this solution: https://smallrye.io/smallrye-stork/2.6.0/service-discovery/dns/ and my thought was that I just have to do this setup, with "stork://my-service/" s baseUri and it is possible without Consul. Is this correct? |
Beta Was this translation helpful? Give feedback.
-
You can check this project based in the stork-dns-quickstart with a mvn service correctly resolved |
Beta Was this translation helpful? Give feedback.
OK, I think I know what is wrong now:
First of all, I opened all my local ports, so the timeout problem is gone (I still need to narrow it down which ports were exactly the problem).
Second, I have to create some Header Handler (implement org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory) that extends the header by "Host: service.example.com". This is needed, because otherweise the request runs into a "wrong location" or in other words, it is like invoking the IP in browser (and obviously it doesn necessarily mean that the "real" website is the landing page)
The basic problems are solved now. Thanks for your support.