assimbly / runtime

Java & REST API's for creating and running integrations
Apache License 2.0
17 stars 3 forks source link

Enrich option 'Add attachment' gives 500 #212

Closed Hooghof closed 1 week ago

Hooghof commented 1 month ago

Instance: next Tenant: Regression Tests Flow: Enrich Postman test: Enrich Attachment

Error:

{
  "code": 500,
  "error": "org.apache.camel.ExchangeTimedOutException: The OUT message was not received within: 10000 millis due reply message with correlationID: Camel-050CB59B7C09249-000000000000036C not received on destination: temp-queue://ID:next-assimbly-test-37075-1716371466015-1:252:1. Exchange[050CB59B7C09249-000000000000036B]",
  "info": "Something went wrong calling the HTTP service. Please refer to the logs for more information."
}
skin27 commented 1 month ago

Norman slacked the following:

This was also an issue from Camel 2 to 3. See:

Environment: next: Tenant: RegressionTests Flow: EnrichWithAttachement

I tested this one locally, and it seemed to work fine there.

Maybe you can do the test:

Looking at the logging of the Assimbly container. Does it give more information than the 500? If you run the test in synchronous, what do you get as an error message?

skin27 commented 1 month ago

Detailed error:

Failed delivery for (MessageId: queue_ID_650c5ca1c0985600130000af_test_ba44c660-f4fa-4ae0-a196-d74c6e90945a_attachment_ID_next-assimbly-test-36929-1716786186835-1_87_1_1_1 on ExchangeId: 8D1E1D057611ADF-0000000000001497). Exhausted after delivery attempt: 1 caught: jakarta.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_225937320.1716793424890". Processed by failure processor: FatalFallbackErrorHandler[null] Message History --------------------------------------------------------------------------------------------------------------------------------------- Source ID Processor Elapsed (ms) route:2 ID_650c5ca1c0985600130000af-bb from[activemq://ID_650c5ca1c0985600130000af_test_b 281 route:3 ID_650c5ca1c0985600130000af-bb step 0 route:4 ID_650c5ca1c0985600130000af-bb mock:x 0 route:5 ID_650c5ca1c0985600130000af-bb choice[when[simple{${header.Content-Type} contains 0 route:11 ID_650c5ca1c0985600130000af-bb setProperty[Enrich-Type] 0 route:14 ID_650c5ca1c0985600130000af-bb setProperty[Error-Route] 0 route:17 ID_650c5ca1c0985600130000af-bb enrich[simple{activemq:ID_650c5ca1c0985600130000af 227 route:20 ID_650c5ca1c0985600130000af-bb marshal[org.apache.camel.model.dataformat.MimeMult 0 route:5 onException70/setExchangePatte setExchangePattern[InOnly] 0 route:6 onException70/to821 direct:ID_650c5ca1c0985600130000af_test_64c23cec01 10 route:7 ID_650c5ca1c0985600130000af-72 step 9 route:8 ID_650c5ca1c0985600130000af-72 mock:x 0 route:9 ID_650c5ca1c0985600130000af-72 setHeader[errorMessage] 0 route:12 ID_650c5ca1c0985600130000af-72 direct:ID_650c5ca1c0985600130000af_test_727dce86-d 5 route:7 ID_650c5ca1c0985600130000af-a7 step 4 route:8 ID_650c5ca1c0985600130000af-a7 mock:x 0 route:9 ID_650c5ca1c0985600130000af-a7 setHeader[CamelVelocityTemplate] 0 route:12 ID_650c5ca1c0985600130000af-a7 velocity:generate?allowTemplateFromHeader=true 0 Exchange --------------------------------------------------------------------------------------------------------------------------------------- Exchange[ Id 8D1E1D057611ADF-0000000000001497 Headers {Accept=*/*, Accept-Encoding=gzip, deflate, br, bodyType=attachment, breadcrumbId=8D1E1D057611ADF-0000000000001491_attachment, Cache-Control=no-cache, CamelJmsDeliveryMode=2, CamelMessageTimestamp=1716793424645, CamelRedelivered=false, CamelRedeliveryCounter=0, CamelServletContextPath=/regressiontests/Enrich, ComponentInitTime=1716793424649, Connection=close, Content-Length=765, Content-Type=application/xml, errorMessage=no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_225937320.1716793424890", Host=assimbly-test.dovetail.world:9001, JMSCorrelationID=Camel-8D1E1D057611ADF-0000000000001496, JMSCorrelationIDAsBytes=[B@39db19cb, JMSDeliveryMode=2, JMSDestination=queue://ID_650c5ca1c0985600130000af_test_ba44c660-f4fa-4ae0-a196-d74c6e90945a_attachment, JMSExpiration=1716879824645, JMSMessageID=ID:next-assimbly-test-36929-1716786186835-1:87:1:1:1, JMSPriority=4, JMSRedelivered=false, JMSReplyTo=temp-queue://ID:next-assimbly-test-36929-1716786186835-1:94:1, JMSTimestamp=1716793424645, JMSType=null, JMSXGroupID=null, JMSXUserID=null, Postman-Token=9f687877-0508-4fa4-b7b4-1513ce979413, User-Agent=PostmanRuntime/7.39.0} BodyType String Body <?xml version="1.0" encoding="UTF-8"?><bicycle_brands> <brand> <name>Trek</name> <country>United States</country> <founded>1976</founded> <website>www.trekbikes.com</website> </brand> <brand> <name>Giant</name> <country>Taiwan</country> <founded>1972</founded> <website>www.giant-bicycles.com</website> </brand> <brand> <name>Cannondale</name> <country>United States</country> <founded>1971</founded> <website>www.cannondale.com</website> </brand> <brand> <name>Specialized</name> <country>United States</country> <founded>1974</founded> <website>www.specialized.com</website> </brand></bicycle_brands> ] Stacktrace --------------------------------------------------------------------------------------------------------------------

skin27 commented 1 month ago

This works local on my machine. Need to test this together with Bruno.

skin27 commented 1 month ago

The config:

`

<streamCaching id="streamCacheConfig" spoolThreshold="0" spoolDirectory="tmp/camelcontext-#camelId#" spoolUsedHeapMemoryThreshold="70"/>
<threadPoolProfile id="wiretapProfile" defaultProfile="false" poolSize="0" maxPoolSize="5" maxQueueSize="2000" rejectedPolicy="DiscardOldest" keepAliveTime="10"/>
<threadPoolProfile id="defaultProfile" defaultProfile="true" poolSize="0" maxPoolSize="10" maxQueueSize="1000" rejectedPolicy="CallerRuns" keepAliveTime="30"/>
<dataFormats>
    <mimeMultipart id="multipart-97ca0436-e215-4fcd-88bb-e16a70c95bd3"/>
</dataFormats>
<onException>
    <exception>java.lang.Exception</exception>
    <redeliveryPolicy maximumRedeliveries="0" redeliveryDelay="5000"/>
    <setExchangePattern pattern="InOnly"/>
</onException>
<interceptFrom>
    <to uri="bean:dovetailTracer?method=traceEvent"/>
</interceptFrom>
<route id="2e6e8a5e-b157-4d6d-8af1-c2db0e69dba7">
    <from uri="jetty-nossl:http://0.0.0.0:9001/regressiontests/EnrichWithAttachment?httpBinding=#customHttpBinding&amp;matchOnUriPrefix=false"/>
    <removeHeaders pattern="CamelHttp*"/>
    <to uri="direct:ID_65644b204ba02e0109000d6f_test_2e6e8a5e-b157-4d6d-8af1-c2db0e69dba7?exchangePattern=InOut"/>
</route>
<route id="97ca0436-e215-4fcd-88bb-e16a70c95bd3">
    <from uri="direct:ID_65644b204ba02e0109000d6f_test_2e6e8a5e-b157-4d6d-8af1-c2db0e69dba7"/>
    <choice>
        <when>
            <simple>${header.Content-Type} contains "multipart/mixed"</simple>
            <unmarshal ref="multipart-97ca0436-e215-4fcd-88bb-e16a70c95bd3"/>
        </when>
    </choice>
    <setProperty propertyName="Enrich-Type">
        <simple>application/attachment</simple>
    </setProperty>
    <setProperty propertyName="Error-Route">
        <simple>true</simple>
    </setProperty>
    <enrich strategyRef="CurrentEnrichStrategy">
        <simple>direct:ID_65644b204ba02e0109000d6f_test_97ca0436-e215-4fcd-88bb-e16a70c95bd3_BottomCenter</simple>
    </enrich>
    <marshal ref="multipart-97ca0436-e215-4fcd-88bb-e16a70c95bd3"/>
    <to uri="direct:ID_65644b204ba02e0109000d6f_test_97ca0436-e215-4fcd-88bb-e16a70c95bd3"/>
</route>
<route id="743ce282-7529-41f3-9d2a-1607243edce3">
    <from uri="direct:ID_65644b204ba02e0109000d6f_test_97ca0436-e215-4fcd-88bb-e16a70c95bd3"/>
    <to uri="replace://?regex=RAW(LS0tLS0tPV9QYXJ0X1xkKl9cZCpcLlxkKnwJZmlsZW5hbWU9IklEXDphY2NlcHRhbmNlLXRlc3QtXGQqLVxkKi1cZCo6XGQqOlxkXDpcZDpcZCI=)&amp;replaceWith=RAW()&amp;group=0&amp;flags="/>
    <to uri="direct:ID_65644b204ba02e0109000d6f_test_743ce282-7529-41f3-9d2a-1607243edce3"/>
</route>
<route id="c518e20b-82c9-4277-8abe-32a5354d4d07">
    <from uri="direct:ID_65644b204ba02e0109000d6f_test_743ce282-7529-41f3-9d2a-1607243edce3"/>
    <to uri="log:nl.kabisa.flux//?skipBodyLineSeparator=false&amp;multiline=true&amp;showHeaders=false&amp;showBody=true&amp;showBodyType=true&amp;showFiles=true&amp;showException=false&amp;showStackTrace=false&amp;showCaughtException=false"/>
</route>
<route id="8c9db37a-f2ee-4424-9b3f-85b480926a43">
    <from uri="direct:ID_65644b204ba02e0109000d6f_test_97ca0436-e215-4fcd-88bb-e16a70c95bd3_BottomCenter"/>
    <setHeader headerName="CamelVelocityTemplate">
        <simple>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;bicycle_parts&gt; &lt;part&gt; &lt;name&gt;Handlebar&lt;/name&gt; &lt;type&gt;Steering&lt;/type&gt; &lt;material&gt;Aluminum&lt;/material&gt; &lt;color&gt;Black&lt;/color&gt; &lt;weight&gt;350 grams&lt;/weight&gt; &lt;/part&gt; &lt;part&gt; &lt;name&gt;Frame&lt;/name&gt; &lt;type&gt;Main&lt;/type&gt; &lt;material&gt;Carbon Fiber&lt;/material&gt; &lt;color&gt;Red&lt;/color&gt; &lt;weight&gt;1500 grams&lt;/weight&gt; &lt;/part&gt; &lt;part&gt; &lt;name&gt;Saddle&lt;/name&gt; &lt;type&gt;Seating&lt;/type&gt; &lt;material&gt;Leather&lt;/material&gt; &lt;color&gt;Brown&lt;/color&gt; &lt;weight&gt;280 grams&lt;/weight&gt; &lt;/part&gt; &lt;part&gt; &lt;name&gt;Wheel&lt;/name&gt; &lt;type&gt;Wheelset&lt;/type&gt; &lt;material&gt;Aluminum Alloy&lt;/material&gt; &lt;color&gt;Silver&lt;/color&gt; &lt;weight&gt;850 grams&lt;/weight&gt; &lt;/part&gt; &lt;/bicycle_parts&gt; </simple>
    </setHeader>
    <to uri="velocity:generate"/>
</route>
<property key="frontend.engine" value="dovetail"/>

`

brunovg commented 1 month ago

Also works on my local machine. I get the following output:


Content-Type: application/octet-stream
Content-Transfer-Encoding: base64

Content-Type: application/xml
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=0316780DEB7677C-0000000000000001

<?xml version="1.0" encoding="UTF-8"?>
<bicycle_parts>
  <part>
    <name>Handlebar</name>
    <type>Steering</type>
    <material>Aluminum</material>
    <color>Black</color>
    <weight>350 grams</weight>
  </part>
  <part>
    <name>Frame</name>
    <type>Main</type>
    <material>Carbon Fiber</material>
    <color>Red</color>
    <weight>1500 grams</weight>
  </part>
  <part>
    <name>Saddle</name>
    <type>Seating</type>
    <material>Leather</material>
    <color>Brown</color>
    <weight>280 grams</weight>
  </part>
  <part>
    <name>Wheel</name>
    <type>Wheelset</type>
    <material>Aluminum Alloy</material>
    <color>Silver</color>
    <weight>850 grams</weight>
  </part>
</bicycle_parts>
--
skin27 commented 1 month ago

Yeah, that seems to be correct. Let's check it after the deployment o.n Monday.