Skip to content

Commit 938d9e3

Browse files
committed
Review: mark->value, docs
1 parent e25154e commit 938d9e3

File tree

4 files changed

+28
-30
lines changed

4 files changed

+28
-30
lines changed

docs/src/main/asciidoc/http-reference.adoc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -591,21 +591,19 @@ link:https://undertow.io/undertow-docs/undertow-docs-2.0.0/index.html#predicates
591591

592592
If you are using a `web.xml` file as your configuration file, you can place it in the `src/main/resources/META-INF` directory.
593593

594-
== References
594+
=== Built-in route order values
595595

596-
=== Well-known route order values
596+
Route order values are the values that are specified via Vert.x route `io.vertx.ext.web.Route.order(int)` function.
597597

598-
Route order marks are the values that are specified via Vert.x route `io.vertx.ext.web.Route.order(int)` function.
599-
600-
Quarkus uses a couple of route order marks itself. Your route order mark values should be at least a positive integer
601-
value above `20000` (see `RouteConstants.ROUTE_ORDER_AFTER_DEFAULT_MARK`) to not interfere with the functionality provided
602-
by Quarkus or its extensions.
598+
Quarkus registers a couple of routes with specific order values.
599+
The constants are defined in the `io.quarkus.vertx.http.runtime.RouteConstants` class and listed in the table below.
600+
A custom route should define the order of value 20000 or higher so that it does not interfere with the functionality provided by Quarkus and extensions.
603601

604602
Route order constants defined in `io.quarkus.vertx.http.runtime.RouteConstants` and known extensions:
605603

606604
[cols="1,1,3"]
607605
|===
608-
| Route order mark| Constant name| Origin
606+
| Route order value| Constant name| Origin
609607
| `Integer.MIN_VALUE` | `ROUTE_ORDER_ACCESS_LOG_HANDLER` | Access-log handler, if enabled in the configuration.
610608
| `Integer.MIN_VALUE` | `ROUTE_ORDER_RECORD_START_TIME` | Handler adding the start-time, if enabled in the configuration.
611609
| `Integer.MIN_VALUE` | `ROUTE_ORDER_HOT_REPLACEMENT` | -replacement body handler.
@@ -615,7 +613,7 @@ Route order constants defined in `io.quarkus.vertx.http.runtime.RouteConstants`
615613
| `Integer.MIN_VALUE + 1` | `ROUTE_ORDER_BODY_HANDLER` | Body handler.
616614
| `-2` | `ROUTE_ORDER_UPLOAD_LIMIT` | Route that enforces the upload body size limit.
617615
| `0` | `ROUTE_ORDER_COMPRESSION` | Compression handler.
618-
| `1000` | `ROUTE_ORDER_BEFORE_DEFAULT_MARK` | Route with priority over the default route (add an offset from this mark).
616+
| `1000` | `ROUTE_ORDER_BEFORE_DEFAULT` | Route with priority over the default route (add an offset from this value).
619617
| `10000` | `ROUTE_ORDER_DEFAULT` | Default route order (i.e. Static Resources, Servlet).
620-
| `20000` | `ROUTE_ORDER_AFTER_DEFAULT_MARK` | Route without priority over the default route (add an offset from this mark)
618+
| `20000` | `ROUTE_ORDER_AFTER_DEFAULT` | Route without priority over the default route (add an offset from this value)
621619
|===

extensions/resteasy-classic/resteasy/deployment/src/main/java/io/quarkus/resteasy/deployment/ResteasyStandaloneBuildStep.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void boot(ShutdownContextBuildItem shutdown,
136136
routes.produce(
137137
RouteBuildItem.builder()
138138
.orderedRoute(standalone.deploymentRootPath,
139-
RouteConstants.ROUTE_ORDER_AFTER_DEFAULT_MARK + REST_ROUTE_ORDER_OFFSET)
139+
RouteConstants.ROUTE_ORDER_AFTER_DEFAULT + REST_ROUTE_ORDER_OFFSET)
140140
.handler(handler).build());
141141
String matchPath = standalone.deploymentRootPath;
142142
if (matchPath.endsWith("/")) {
@@ -146,7 +146,7 @@ public void boot(ShutdownContextBuildItem shutdown,
146146
}
147147
// Match paths that begin with the deployment path
148148
routes.produce(RouteBuildItem.builder()
149-
.orderedRoute(matchPath, RouteConstants.ROUTE_ORDER_AFTER_DEFAULT_MARK + REST_ROUTE_ORDER_OFFSET)
149+
.orderedRoute(matchPath, RouteConstants.ROUTE_ORDER_AFTER_DEFAULT + REST_ROUTE_ORDER_OFFSET)
150150
.handler(handler).build());
151151

152152
recorder.start(shutdown, requireVirtual.isPresent());

extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,11 +1251,11 @@ public void setupDeployment(BeanContainerBuildItem beanContainerBuildItem,
12511251
.produce(new ResteasyReactiveDeploymentInfoBuildItem(deploymentInfo));
12521252

12531253
boolean servletPresent = false;
1254-
int order = RouteConstants.ROUTE_ORDER_AFTER_DEFAULT_MARK + REST_ROUTE_ORDER_OFFSET;
1254+
int order = RouteConstants.ROUTE_ORDER_AFTER_DEFAULT + REST_ROUTE_ORDER_OFFSET;
12551255
if (capabilities.isPresent("io.quarkus.servlet")) {
12561256
//if servlet is present we run RR before the default route
12571257
//otherwise we run after it
1258-
order = RouteConstants.ROUTE_ORDER_BEFORE_DEFAULT_MARK + REST_ROUTE_ORDER_OFFSET;
1258+
order = RouteConstants.ROUTE_ORDER_BEFORE_DEFAULT + REST_ROUTE_ORDER_OFFSET;
12591259
servletPresent = true;
12601260
}
12611261

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
11
package io.quarkus.vertx.http.runtime;
22

33
/**
4-
* Route order mark constants used in Quarkus, update {@code reactive-routes.adoc} when changing this class.
4+
* Route order value constants used in Quarkus, update {@code reactive-routes.adoc} when changing this class.
55
*/
66
@SuppressWarnings("JavadocDeclaration")
77
public final class RouteConstants {
88
private RouteConstants() {
99
}
1010

1111
/**
12-
* Order mark ({@value #ROUTE_ORDER_ACCESS_LOG_HANDLER}) for the access-log handler, if enabled in the configuration.
12+
* Order value ({@value #ROUTE_ORDER_ACCESS_LOG_HANDLER}) for the access-log handler, if enabled in the configuration.
1313
*/
1414
public static final int ROUTE_ORDER_ACCESS_LOG_HANDLER = Integer.MIN_VALUE;
1515
/**
16-
* Order mark ({@value #ROUTE_ORDER_RECORD_START_TIME}) for the handler adding the start-time, if enabled in the
16+
* Order value ({@value #ROUTE_ORDER_RECORD_START_TIME}) for the handler adding the start-time, if enabled in the
1717
* configuration.
1818
*/
1919
public static final int ROUTE_ORDER_RECORD_START_TIME = Integer.MIN_VALUE;
2020
/**
21-
* Order mark ({@value #ROUTE_ORDER_HOT_REPLACEMENT}) for the hot-replacement body handler.
21+
* Order value ({@value #ROUTE_ORDER_HOT_REPLACEMENT}) for the hot-replacement body handler.
2222
*/
2323
public static final int ROUTE_ORDER_HOT_REPLACEMENT = Integer.MIN_VALUE;
2424
/**
25-
* Order mark ({@value #ROUTE_ORDER_BODY_HANDLER_MANAGEMENT}) for the body handler for the management router.
25+
* Order value ({@value #ROUTE_ORDER_BODY_HANDLER_MANAGEMENT}) for the body handler for the management router.
2626
*/
2727
public static final int ROUTE_ORDER_BODY_HANDLER_MANAGEMENT = Integer.MIN_VALUE;
2828
/**
29-
* Order mark ({@value #ROUTE_ORDER_HEADERS}) for the handlers that add headers specified in the configuration.
29+
* Order value ({@value #ROUTE_ORDER_HEADERS}) for the handlers that add headers specified in the configuration.
3030
*/
3131
public static final int ROUTE_ORDER_HEADERS = Integer.MIN_VALUE;
3232
/**
33-
* Order mark ({@value #ROUTE_ORDER_CORS_MANAGEMENT}) for the CORS-Origin handler of the management router.
33+
* Order value ({@value #ROUTE_ORDER_CORS_MANAGEMENT}) for the CORS-Origin handler of the management router.
3434
*/
3535
public static final int ROUTE_ORDER_CORS_MANAGEMENT = Integer.MIN_VALUE;
3636
/**
37-
* Order mark ({@value #ROUTE_ORDER_BODY_HANDLER}) for the body handler.
37+
* Order value ({@value #ROUTE_ORDER_BODY_HANDLER}) for the body handler.
3838
*/
3939
public static final int ROUTE_ORDER_BODY_HANDLER = Integer.MIN_VALUE + 1;
4040
/**
41-
* Order mark ({@value #ROUTE_ORDER_UPLOAD_LIMIT}) for the route that enforces the upload body size limit.
41+
* Order value ({@value #ROUTE_ORDER_UPLOAD_LIMIT}) for the route that enforces the upload body size limit.
4242
*/
4343
public static final int ROUTE_ORDER_UPLOAD_LIMIT = -2;
4444
/**
45-
* Order mark ({@value #ROUTE_ORDER_COMPRESSION}) for the compression handler.
45+
* Order value ({@value #ROUTE_ORDER_COMPRESSION}) for the compression handler.
4646
*/
4747
public static final int ROUTE_ORDER_COMPRESSION = 0;
4848
/**
49-
* Order mark ({@value #ROUTE_ORDER_BEFORE_DEFAULT_MARK}) for route with priority over the default route (add an offset from
50-
* this mark)
49+
* Order value ({@value #ROUTE_ORDER_BEFORE_DEFAULT}) for route with priority over the default route (add an offset from
50+
* this value)
5151
*/
52-
public static final int ROUTE_ORDER_BEFORE_DEFAULT_MARK = 1_000;
52+
public static final int ROUTE_ORDER_BEFORE_DEFAULT = 1_000;
5353
/**
5454
* Default route order (i.e. Static Resources, Servlet): ({@value #ROUTE_ORDER_DEFAULT})
5555
*/
5656
public static final int ROUTE_ORDER_DEFAULT = 10_000;
5757
/**
58-
* Order mark ({@value #ROUTE_ORDER_AFTER_DEFAULT_MARK}) for route without priority over the default route (add an offset
59-
* from this mark)
58+
* Order value ({@value #ROUTE_ORDER_AFTER_DEFAULT}) for route without priority over the default route (add an offset
59+
* from this value)
6060
*/
61-
public static final int ROUTE_ORDER_AFTER_DEFAULT_MARK = 20_000;
61+
public static final int ROUTE_ORDER_AFTER_DEFAULT = 20_000;
6262
}

0 commit comments

Comments
 (0)