简体   繁体   English

Apache camel ftp组件-成功传输的通知

[英]Apache camel ftp component - notification on successful transfer

We are in the process of building a Java application with Camel to transfer files between two FTP locations. 我们正在使用Camel构建Java应用程序以在两个FTP位置之间传输文件。 Is there a way to get a notification on the successful transfer of a file? 有没有办法获得文件成功传输的通知? We are not allowed to use a JMS solution for building the application. 我们不允许使用JMS解决方案来构建应用程序。

I hope you could create another route and have seda/vm as the endpoint.This endpoint needs to be called after the ftp endpoint. 我希望您可以创建另一条路由并将seda / vm作为端点。需要在ftp端点之后调用此端点。

<route id="MainRoute">
<from uri="ftp:RemoteLocation"/> 
<from uri="seda:Retry"/>
<to uri="seda:MyLog"/>
<!--Your Main Processing logic -->
</route>

<route id="Notification-processor">
<from uri="seda:MyLog"/>
<!--Your Logging/Notification Processing logic -->
</route>

In the above scenario of Notification-processor you can have your custom notificaiton/log activity. 在上面的通知处理器场景中,您可以进行自定义通知/日志活动。 This is your custom notification logic. 这是您的自定义通知逻辑。 If you need to notify for anomalies you can have a to endpoint in the Notification-processor for sending the notification. 如果需要通知异常,则可以在通知处理器中使用to终结点来发送通知。

You need to write logic to check if the message is complete if not you can have a bean called in the Notification-processor which can have dynamic route to extract the specific file form the ftp location and reprocess it. 您需要编写逻辑来检查消息是否完整,如果没有,则可以在Notification-processor中调用一个Bean,该Bean可以具有动态路由,以从ftp位置提取特定文件并对其进行重新处理。 Like below 像下面

<route id="Notification-processor">
<from uri="seda:MyLog"/>
<!--Anomaly checker  -->
<to uri="seda:Retry"/>
<!--Your Logging/Notification Processing logic -->
</route>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM