Tag: mule

使用拦截器计算Mule流的处理时间

我想计算我的mule流执行所需的执行时间,所以我使用了拦截器,这里是我的拦截器代码 class CustomLoggerInterceptor extends AbstractEnvelopeInterceptor { @Override public MuleEvent last(MuleEvent event, ProcessingTime time, long startTime, boolean exceptionWasThrown) throws MuleException { long totalTime=time.getStatistics().getTotalProcessingTime(); LOG.info(“Start time for flow: “+event.getFlowConstruct().getName()+” is: “+startTime+” total execution time is: “+totalTime); return event; } //other inherited methods } 现在的问题是,每当我执行我的mule流时,我从time.getStatistics().getTotalProcessingTime()得到的所有值time.getStatistics().getTotalProcessingTime()总是为’0’。 我使用正确的方法还是犯了一些错误? 我基本上需要一种从ProcessingTime对象中查找执行时间的方法。 任何指针赞赏 谢谢!

Mule Zip文件并向FTP服务器发送压缩文件

我知道Mule非常支持使用该元素对数据进行gzip压缩。 但是客户端现在想要压缩压缩,因为文件必须作为zip压缩文件放在FTP上:( 我遇到以下情况的mule子困难: 我创建了一个文件进来的Spring bean。我想使用ZipOutputStream类压缩这个文件并将它传递给我们的ftp。 这是我的流程配置: 这是我的zip压缩器的代码: @Component public class ZipCompressor implements Callable { private static final Logger LOG = LogManager.getLogger(ZipCompressor.class.getName()); @Override @Transactional public Object onCall(MuleEventContext eventContext) throws Exception { if (eventContext.getMessage().getPayload() instanceof File) { final File srcFile = (File) eventContext.getMessage().getPayload(); final String fileName = srcFile.getName(); final File zipFile = new File(fileName + “.zip”); try […]

如何使用Talend Open Studio数据集成创建属性文件?

我曾经使用过Talend Open Integration studio来创建作业并从IDE运行它或将其导出为可执行jar文件。 但我没有广泛使用它。 是否可以创建一个包含不同服务器名称和其他变量的外部配置文件,以便在创建我的Talend作业的可执行jar文件后,我可以更改配置文本文件并选择不同的数据库服务器或端口选项? 我也使用了MuleSoft一点点,所以如果有人知道如何使用MuleSoft做任何建议,将不胜感激。