ppalaga commented on a change in pull request #323: Fix #322 Make 
camel-attachments an optional dependency of platform-http
URL: https://github.com/apache/camel-quarkus/pull/323#discussion_r338505881
 
 

 ##########
 File path: 
extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CoreAttachmentsRecorder.java
 ##########
 @@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+package org.apache.camel.quarkus.core;
+
+import java.io.File;
+
+import org.apache.camel.Message;
+import org.jboss.logging.Logger;
+
+import io.quarkus.runtime.RuntimeValue;
+import io.quarkus.runtime.annotations.Recorder;
+
+@Recorder
+public class CoreAttachmentsRecorder {
+
+    private static final Logger LOG = 
Logger.getLogger(CoreAttachmentsRecorder.class);
+
+    public RuntimeValue<UploadAttacher> createNoOpUploadAttacher() {
+        return new RuntimeValue<>((File localFile, String fileName, Message 
message) -> {
+            LOG.trace("File %s not attached to message %s because 
camel-quarkus-attachments is not in the class path");
 
 Review comment:
   @lburgazzoli  made me agree in the end. I was originally thinking only about 
the malevolent clients and though that the app ops do not want to see a stack 
trace for every such attempt. I also assumed that such cases might be desired, 
but now I think they are not. It is OK to fail for both malevolent and broken 
clients.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to