ule在流中从类路径中读取单个文件 [英] mule read single file from classpath during flow
本文介绍了ule在流中从类路径中读取单个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一种简单的方法来配置Flow以一次从类路径读取单个文件?我不需要轮询文件.我只需要读取一个已知文件并将其内容设置为消息有效负载即可.
Is there an easy way to configure a Flow to read a single file from the classpath one time? I don't need to poll for a file. I just need to read a known file and set its contents as the message payload.
推荐答案
使用set-payload
消息处理器和MEL表达式:
Use the set-payload
message processor and a MEL expression:
<set-payload value="#[Thread.currentThread().getContextClassLoader().getResourceAsStream('my-file.abc')]" />
这篇关于ule在流中从类路径中读取单个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文