question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Have armeria always add a fallback Service for not found requests?

See original GitHub issue

I found in https://github.com/openzipkin/zipkin/pull/2348 that there is somewhat confusing behavior regarding ServerBuilder.decorator - as it only decorates mapped services, requests that aren’t mapped and returned as NOT_FOUND are not handled by the decorator. If the decorator is for metrics collection, and has logic for not found requests, it doesn’t work.

Does it make sense to have armeria always add a service at the end for not_found requests to make sure behavior is consistent with mapped requests?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
trustincommented, Nov 12, 2019

WRT custom status rendering, here, we could translate an HttpStatusException into an HttpResponse using a Function<HttpStatusException, HttpResponse>.

The 404-responding service could raise HttpStatusException.of(404) to take advantage of this feature.

2reactions
trustincommented, Nov 12, 2019

The proposal intends to provide a universal way to handle both 404 and HttpStatusException, but I found that 404 and HttpStatusException are different; If HttpStatusException is raised, it means the service has been invoked already, so issuing another request will create an extra request log.

So… let me drop the proposal and just make the following changes:

  • Modify ServerBuilder and VirtualHostBuilder so that a 404-responding service is bound automatically at prefix:/ as the last service, if not duplicate.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Serving static files — Armeria documentation
Use FileService to serve static files under a certain directory. FileService supports GET and HEAD HTTP methods and will auto-fill Date , Last-Modified...
Read more >
com.linecorp.armeria.client.Client java code examples | Tabnine
Sends a Request to a remote Endpoint. Note that this interface is not a user's entry point for sending a Request. It is...
Read more >
Index (Armeria 0.69.0 API reference) - Javadoc.io
Adds the specified RequestLogListener so that it's notified when all of the specified RequestLogAvailability s are satisfied.
Read more >
python - ImportError: No module named requests
Requests is not a built in module (does not come with the default python installation), so you will have to install it: OSX/Linux....
Read more >
Circuit breakers for distributed services - LINE ENGINEERING
If no one has been keeping an eye on the entire network, ... Starting with version 0.13.0 of Armeria, it is possible to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found