Skip to content

Commit

Permalink
Merge pull request #605 from swisspost/develop
Browse files Browse the repository at this point in the history
PR for release
  • Loading branch information
mcweba authored Aug 8, 2024
2 parents 9ccff43 + fc56891 commit 21dfa68
Show file tree
Hide file tree
Showing 27 changed files with 45 additions and 30 deletions.
2 changes: 1 addition & 1 deletion gateleen-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-cache</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-delegate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-delegate</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-delta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-delta</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-expansion/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-expansion</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-hook-js/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>
<artifactId>gateleen-hook-js</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-hook/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-hook</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-kafka/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-kafka</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-logging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-logging</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-merge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-merge</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-monitoring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-monitoring</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-packing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-packing</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-player/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-player</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-playground/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-playground</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-qos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-qos</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-queue/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-queue</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
import org.swisspush.gateleen.queue.queuing.circuitbreaker.util.QueueCircuitState;
import org.swisspush.gateleen.queue.queuing.circuitbreaker.util.QueueResponseType;

import static io.vertx.core.Future.failedFuture;
import static io.vertx.core.Future.succeededFuture;
import static io.vertx.core.buffer.Buffer.buffer;
import static java.lang.System.currentTimeMillis;
import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenThriftyExceptionFactory;
import static org.swisspush.gateleen.queue.queuing.circuitbreaker.util.QueueResponseType.FAILURE;
import static org.swisspush.gateleen.queue.queuing.circuitbreaker.util.QueueResponseType.SUCCESS;
Expand Down Expand Up @@ -290,7 +294,18 @@ private void executeQueuedRequest(Message<JsonObject> message, Logger logger, Ht
};
request1.idleTimeout(120000); // avoids blocking other requests
if (queuedRequest.getPayload() != null) {
request1.send(Buffer.buffer(queuedRequest.getPayload()), httpAsyncHandler);
vertx.<Buffer>executeBlocking(() -> {
long beginEpchMs = currentTimeMillis();
Buffer payload = buffer(queuedRequest.getPayload());
long durationMs = currentTimeMillis() - beginEpchMs;
if (durationMs > 16) logger.debug("Creating buffer of size {} took {}ms", payload.length(), durationMs);
return payload;
}, false).compose((Buffer payload) -> {
request1.send(payload, httpAsyncHandler);
return succeededFuture();
}).onFailure((Throwable ex) -> {
httpAsyncHandler.handle(failedFuture(ex));
});
} else {
request1.send(httpAsyncHandler);
}
Expand Down
2 changes: 1 addition & 1 deletion gateleen-routing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-routing</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public void handle(final RoutingContext ctx) {
monitoringHandler.updateRequestsMeter("localhost", ctx.request().uri());
monitoringHandler.updateRequestPerRuleMonitoring(ctx.request(), rule.getMetricName());
final long startTime = monitoringHandler.startRequestMetricTracking(rule.getMetricName(), ctx.request().uri());
log.debug("Forwarding request: {} to storage {} {} with rule {}", ctx.request().uri(), rule.getStorage(),
targetUri, rule.getRuleIdentifier());
log.debug("Forwarding {} request: {} to storage {} {} with rule {}", ctx.request().method(), ctx.request().uri(),
rule.getStorage(), targetUri, rule.getRuleIdentifier());
final HeadersMultiMap requestHeaders = new HeadersMultiMap();
requestHeaders.addAll(ctx.request().headers());

Expand Down Expand Up @@ -102,14 +102,14 @@ public void handle(final RoutingContext ctx) {
response.setStatusCode(StatusCode.INTERNAL_SERVER_ERROR.getStatusCode());
response.setStatusMessage(statusMessage);
response.end();
log.error(statusMessage, gateleenExceptionFactory.newException(result.cause()));
log.error("{}", statusMessage, gateleenExceptionFactory.newException(result.cause()));
} else {
Buffer buffer = result.result().body();
int headerLength = buffer.getInt(0);
JsonObject responseJson = new JsonObject(buffer.getString(4, headerLength + 4));
JsonArray headers = responseJson.getJsonArray("headers");
MultiMap responseHeaders = null;
if (headers != null && headers.size() > 0) {
if (headers != null && !headers.isEmpty()) {
responseHeaders = JsonMultiMap.fromJson(headers);

setUniqueIdHeader(responseHeaders);
Expand Down
2 changes: 1 addition & 1 deletion gateleen-runconfig/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-runconfig</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-scheduler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-scheduler</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-security</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>
<artifactId>gateleen-test</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-testhelper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-testhelper</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-user/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-user</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gateleen-validation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
</parent>

<artifactId>gateleen-validation</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.swisspush.gateleen</groupId>
<artifactId>gateleen</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.10-SNAPSHOT</version>
<packaging>pom</packaging>
<name>gateleen</name>
<description>Middleware library based on Vert.x to build advanced JSON/REST communication servers</description>
Expand Down

0 comments on commit 21dfa68

Please sign in to comment.