Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST client guide needs to be updated because restcountries.eu is no longer supported #20810

Closed
xstefank opened this issue Oct 17, 2021 · 18 comments · Fixed by #21166
Closed

Comments

@xstefank
Copy link
Contributor

Describe the bug

The test API restcountries.eu in REST client guide is being discontinued - apilayer/restcountries#280. It already doesn't work and thus REST client guide needs to be updated.

Expected behavior

Guides should work?! :)

Actual behavior

https://restcountries.eu is not responding.

How to Reproduce?

Follow the instructions in the guide.

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

There are two possible ways I've found so far:

1/ the replacement https://countrylayer.com/ but it requires registration for API key
2/ backup https://restcountries.com/ which is open-sourced and seems to be maintained https://gitlab.com/amatos/rest-countries

@xstefank xstefank added the kind/bug Something isn't working label Oct 17, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 17, 2021

/cc @michalszynkiewicz

@xstefank
Copy link
Contributor Author

I will gladly fix this but I need to know which road to take.

@xstefank xstefank changed the title REST client guide needs to be updated because of restcountries.eu is no longer supported REST client guide needs to be updated because restcountries.eu is no longer supported Oct 17, 2021
@geoand
Copy link
Contributor

geoand commented Oct 18, 2021

I will gladly fix this but I need to know which road to take.

Great!

We should do what @Sgitario did in the quickstarts: https://github.com/quarkusio/quarkus-quickstarts/blob/main/rest-client-quickstart/src/test/java/org/acme/rest/client/resources/WireMockCountriesResource.java

@michalszynkiewicz
Copy link
Member

michalszynkiewicz commented Oct 18, 2021

I think we should rather switch to a different endpoint in both the quickstart and the guide.
Wiremocking countries makes the tests pass but the app will still fail.

On an issue about Rest Client codestart @ia3andy wrote that for codestart we could use https://code.quarkus.io/api/extensions
Maybe we could use it for the quickstart too?

@xstefank
Copy link
Contributor Author

@michalszynkiewicz I think there is different issue open for codestart.

@geoand as Michal mentioned wiremock will only solve tests but the app is still referenced in dev mode to contact that endpoint. So I still need to know if we will require subscriptions (meesa don't like) or we will switch to restcountries.com.

But I also noticed that the example wiremock server in the guide is wrong. Should I fix that in this issue or open a new one?

@geoand
Copy link
Contributor

geoand commented Oct 18, 2021

But I also noticed that the example wiremock server in the guide is wrong. Should I fix that in this issue or open a new one?

No need for a new issue, just include a fix in a separate commit when you open a PR

@xstefank
Copy link
Contributor Author

@geoand so just to confirm, switching to restcountries.com ?

@geoand
Copy link
Contributor

geoand commented Oct 18, 2021

If that works, sure 😎. I haven't looked into it at all

@ia3andy
Copy link
Contributor

ia3andy commented Oct 18, 2021

@xstefank it could make sense to use code.quarkus.io/api/extensions as it's one of our own service

@michalszynkiewicz
Copy link
Member

how does restcountries.com work? it times out for me now, is it only me?

@ia3andy
Copy link
Contributor

ia3andy commented Oct 18, 2021

same here

@geoand
Copy link
Contributor

geoand commented Oct 18, 2021

Also times out for me

@xstefank
Copy link
Contributor Author

xstefank commented Oct 18, 2021

yep, same here. So it seems that is not so well adjusted for the load that is expected. Thanks, @ia3andy that's a great idea. Do you guys think maybe we can add an endpoint that will return individual extension JSON from the endpoint Andy recommended? so we have something similar as with restcountries. E.g. /api/extensions/name/arc.

@ia3andy
Copy link
Contributor

ia3andy commented Oct 18, 2021

Feel free to add it:
https://github.com/quarkusio/code.quarkus.io/blob/main/api/src/main/kotlin/io/quarkus/code/rest/CodeQuarkusResource.kt#L151

I would use the id instead /api/extensions?id=io.quarkus:quarkus-resteasy and as a query parameter. You would also need to add it to the /api/extensions/streams/{streamKey}.

If you do make sure we prepare a Map by id at init to avoid any unnecessary computation on queries..

@ia3andy
Copy link
Contributor

ia3andy commented Oct 18, 2021

also @xstefank maybe it's wiser to use stage.code.quarkus.io/api the api is the same and availability is nearly the same, both should support the load without too much trouble.

@xstefank
Copy link
Contributor Author

I don't think we need to expect many people will be doing the guide at the same time so the load should be minimal. OK, let's use stage.code.quarkus.io. Thanks, @ia3andy.

@ia3andy
Copy link
Contributor

ia3andy commented Oct 18, 2021

@xstefank would you be interested by this issue also: #20555

@xstefank
Copy link
Contributor Author

@ia3andy I can take a look after this one, sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants