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

davsclaus pushed a commit to branch camel-spring-boot-4.10.x
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git


The following commit(s) were added to refs/heads/camel-spring-boot-4.10.x by 
this push:
     new fe0c258f237 CAMEL-21755: Adjust attachments API on Message to avoid 
issue during routing (#1378)
fe0c258f237 is described below

commit fe0c258f237ea45ddff4bf469d98d3305e6e11c1
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Mon Feb 24 12:05:58 2025 +0000

    CAMEL-21755: Adjust attachments API on Message to avoid issue during 
routing (#1378)
---
 .../platform/http/springboot/SpringBootPlatformHttpBinding.java        | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java
 
b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java
index 0530638ffe8..81a976a87b4 100644
--- 
a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java
+++ 
b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java
@@ -30,6 +30,7 @@ import org.apache.camel.StreamCache;
 import org.apache.camel.TypeConverter;
 import org.apache.camel.attachment.AttachmentMessage;
 import org.apache.camel.attachment.CamelFileDataSource;
+import org.apache.camel.attachment.DefaultAttachmentMessage;
 import org.apache.camel.component.platform.http.PlatformHttpEndpoint;
 import org.apache.camel.component.platform.http.spi.Method;
 import org.apache.camel.converter.stream.CachedOutputStream;
@@ -122,7 +123,7 @@ public class SpringBootPlatformHttpBinding extends 
DefaultHttpBinding {
                     }
 
                     if (accepted) {
-                        AttachmentMessage am = 
message.getExchange().getMessage(AttachmentMessage.class);
+                        AttachmentMessage am = new 
DefaultAttachmentMessage(message);
                         File uploadedFile = uploadedTmpFile.toFile();
                         am.addAttachment(name, new DataHandler(new 
CamelFileDataSource(uploadedFile, name)));
 

Reply via email to