apache / camel-quarkus

Apache Camel Quarkus
https://camel.apache.org
Apache License 2.0
257 stars 191 forks source link

Configure order for routes added by platform-http consumer #2042

Open jamesnetherton opened 3 years ago

jamesnetherton commented 3 years ago

This conversation lead to an interesting discovery about how the Vert.x router route order can affect the behaviour of the platform-http consumer.

TL;DR the user set up a REST route which expected to match method=POST & Content-Type=application/json. When the correct content type was not provided by the client, a 404 response was returned instead of the expected 415.

Turns out that because META-INF/resources was present in the source tree, Quarkus registers Vert.x route(s) to handle the static resources. These are registered after the Camel ones. Thus the 415 response is silently dropped because the static route handlers can't match anything and return a 404.

ppalaga commented 3 years ago

Do we need to do something about this?

jamesnetherton commented 3 years ago

I did start working on a solution. But after this conversation I abandoned it.

If it becomes a frequent issue for folks, then maybe we invest more time on it.