【发布时间】:2016-03-10 12:32:57
【问题描述】:
我试图删除一个附件,以便我的出站电子邮件仅包含有效负载。我使用了附件转换器,但即使我使用“*”作为过滤器,附件仍在发送。我已将其放置在入站和出站端点上,但附件仍在电子邮件中
<remove-attachment attachmentName=""*"" doc:name="Attachment"/>
<flow name="ocr_app_testFlow">
<pop3:inbound-endpoint host="mail.awh.com.au" user="knaufack" password="ocr123" responseTimeout="10000" doc:name="POP3"/>
<logger message="#[message.inboundProperties.subject]" level="INFO" doc:name="Logger"/>
<remove-attachment attachmentName="*" doc:name="Attachment"/>
<choice doc:name="Choice">
<when expression="#[wildcard('*Succeeded*',message.inboundProperties.subject)]">
<set-variable variableName="Subject" value="#[message.inboundProperties.subject]" doc:name="Variable"/>
<set-variable variableName="Warehouse" value="#[message.inboundProperties.subject.substring(40,43)]" doc:name="Variable"/>
<set-variable variableName="Order" value="#[message.inboundProperties.subject.substring(44,51)]" doc:name="Variable"/>
</when>
<otherwise>
<set-variable variableName="Subject" value="#[message.inboundProperties.subject]" doc:name="Variable"/>
<set-variable variableName="Warehouse" value="#[message.inboundProperties.subject.substring(37,40)]" doc:name="Variable"/>
<set-variable variableName="Order" value="#[message.inboundProperties.subject.substring(41,48)]" doc:name="Variable"/>
</otherwise>
</choice>
<logger message="#[flowVars.Order] from #[flowVars.Warehouse]" level="INFO" doc:name="Logger"/>
<set-payload value="Your Order #[flowVars.Order] from #[flowVars.Warehouse] Warehouse is imported succesfully. Please Verify" doc:name="Set Payload"/>
<remove-attachment attachmentName="*" doc:name="Attachment"/>
<choice doc:name="Choice">
<when expression="#[flowVars.Warehouse == 'ROC']">
<smtp:outbound-endpoint host="mail.awh.com.au" user="tupload" password="upload123" to="tupload@awh.com.au" from="AWH_Logistics_Integration" subject="AWH OCR Process Notification" responseTimeout="10000" doc:name="ROC Warehouse"/>
</when>
<otherwise>
<smtp:outbound-endpoint host="mail.awh.com.au" user="tupload" password="upload123" to="pauldominguez@awh.com.au" from="AWH_Logistics_Integration" subject="AWH OCR Process Notification" responseTimeout="10000" doc:name="SMTP"/>
</otherwise>
</choice>
</flow>
【问题讨论】:
-
你试过
attachmentName="*"吗?我不确定这个双引号业务。 -
嗨大卫,是的,我也试过这个。当我在附件变压器的名称字段上放置“*”时,这是由 mule 生成的
-
你能在
org.mule.transformer.simple.RemoveAttachmentTransformer.transformMessage上设置一个断点,然后看看里面发生了什么吗?是否调用了message.removeOutboundAttachment? -
嗨大卫,我不知道该怎么做,但我已经使用调试器放置了一个断点,但附件仍然存在并且即使遇到附件转换器也不会被删除。有什么想法吗?
-
嗯,在这一点上我会说这是一个需要向 MuleSoft 报告的错误。