This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/main by this push:
     new 3f552e0  Reduce console log output from EipTest.throttle
3f552e0 is described below

commit 3f552e0441ced5cc4a37eeb3383c6c2351123b3e
Author: James Netherton <[email protected]>
AuthorDate: Tue Aug 17 08:30:17 2021 +0100

    Reduce console log output from EipTest.throttle
    
    Fixes #3001
---
 .../org/apache/camel/quarkus/eip/it/EipResource.java  | 11 +++++++++--
 .../eip/src/main/resources/application.properties     | 19 +++++++++++++++++++
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git 
a/integration-test-groups/foundation/eip/src/main/java/org/apache/camel/quarkus/eip/it/EipResource.java
 
b/integration-test-groups/foundation/eip/src/main/java/org/apache/camel/quarkus/eip/it/EipResource.java
index 0091b96..13852e3 100644
--- 
a/integration-test-groups/foundation/eip/src/main/java/org/apache/camel/quarkus/eip/it/EipResource.java
+++ 
b/integration-test-groups/foundation/eip/src/main/java/org/apache/camel/quarkus/eip/it/EipResource.java
@@ -31,9 +31,11 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.CamelExecutionException;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.component.mock.MockEndpoint;
 
@@ -51,11 +53,16 @@ public class EipResource {
     @POST
     @Consumes(MediaType.TEXT_PLAIN)
     @Produces(MediaType.TEXT_PLAIN)
-    public String route(String statement, @PathParam("route") String route, 
@Context UriInfo uriInfo) {
+    public Response route(String statement, @PathParam("route") String route, 
@Context UriInfo uriInfo) {
         final Map<String, Object> headers = 
uriInfo.getQueryParameters().entrySet().stream()
                 .map(e -> new AbstractMap.SimpleImmutableEntry<String, 
Object>(e.getKey(), e.getValue().get(0)))
                 .collect(Collectors.toMap(Entry::getKey, Entry::getValue));
-        return producerTemplate.requestBodyAndHeaders("direct:" + route, 
statement, headers, String.class);
+        try {
+            String result = producerTemplate.requestBodyAndHeaders("direct:" + 
route, statement, headers, String.class);
+            return Response.ok(result).build();
+        } catch (CamelExecutionException e) {
+            return Response.serverError().entity(e.getMessage()).build();
+        }
     }
 
     @Path("/mock/{name}/{count}/{timeout}/{part}")
diff --git 
a/integration-test-groups/foundation/eip/src/main/resources/application.properties
 
b/integration-test-groups/foundation/eip/src/main/resources/application.properties
new file mode 100644
index 0000000..ec52f5c
--- /dev/null
+++ 
b/integration-test-groups/foundation/eip/src/main/resources/application.properties
@@ -0,0 +1,19 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+# Reduces noise from throttler ThrottlerRejectedExecutionException
+quarkus.log.category."org.apache.camel.processor".level = OFF

Reply via email to