Directory Watch Publisher
目录观看发布商监视活动的活动资源管理目录或其他位置,并将关于该活动的消息发布到FME服务器主题。活动可以包括添加,更改和删除文件和文件夹。
配置发布者
- 在FME服务器中Web User Interface, 选择通知>出版物,然后点击New。
- 提供出版物的名称
- 协议:选择目录手表。
Specify the话题您希望发布到使用下拉选择器。要创建主题并立即使用它,请单击+。
- 要观看目录: To watch a资源directory, click the ellipsis (......), and select a directory to watch. To watch another directory, enter a local file system or network (UNC) path directly in the textbox.
- 观看子目录: To watch activity in the selected directory and all subdirectories, specify是的。To watch activity only in the selected directory and not in its subdirectories, specifyNo。This setting also applies to directories that are added into the watched directory. IfNo,在添加目录中的文件中未生成单独的通知。
- 收到文件夹通知: 如果是的,Publisher监控两个文件和文件夹的活动。如果No,Publisher仅监视文件的活动。
- 过滤器:默认情况下,发布者会监视指定目录上的所有操作,包括添加(创建),更改(修改)和删除(删除)文件(如果适用)和文件夹)。要仅将发布者应用于其中一个或两个操作,请单击操作旁边的“X”,您不希望监视以删除它。要在删除它后添加一个操作,请单击Dropbox并选择它。
- 民意调查间隔:通常,在几分钟内,调查显示指定的Directory to Watch for activity.
- 初步行动
- 通知
- 删除操作:在当前轮询间隔经过后发送通知。
- CREATE and MODIFY actions: An additional poll interval occurs. If the action is complete after the additional poll interval, a notification is sent. Otherwise, one additional poll interval occurs, and a notification is sent, whether or not the action is complete.
- 点击OK。
笔记:运行FME服务器核心的用户帐户服务必须在任何未被管理为FME服务器资源的目录中读/写(Windows)或读取(Linux)权限。看here有关将目录添加为资源的信息。
笔记:Events trigger based on changes in file name and size. No notification is triggered if a change to an existing file does not change file size, or if a file is overwritten with one of the same size. If a file is overwritten with one of a different size, a MODIFY event is triggered.
发生动作(创建,修改,删除)时,它进入当前轮询间隔,该间隔已被部分过度。
笔记:在发布者无法确定操作是否完成时,最多两种额外的轮询间隔发送通知是作为超时。在某些情况下,通知将被视为过早,可能导致后续工作流中的问题。亚搏在线为了避免这种情况,最好的做法是设置民意调查间隔比完成动作所需的时间长。
笔记:在单个轮询间隔内的同一文件中创建和修改操作,仅触发创建通知。在单个轮询间隔内的同一文件中的创建,修改和删除操作触发器无通知。
示例通知模式
要从目录监视发布者解析传入的JSON消息,请使用Directory Watch ReaderFME Workbench工作区中的自定义格式。有关更多信息并下载读者,请访问FME商店fmestore.safe.com/。
When a file is deleted
{
“dirwatch_publisher_path”:“c:\\ apps \\ fmeserver \\ temp \\ sample_file.txt”,
“dirwatch_publisher_content”:“entry_delete c:\\ apps \\ fmeserver \\ temp \\ sample_file.txt”,
“dirwatch_publisher_action”:“删除”,
"fns_type": "dirwatch_publisher"
}
更改文件时(例如,添加内容)
{
“dirwatch_publisher_path”:“c:\\ apps \\ fmeserver \\ temp \\ sample_file.txt”,
“dirwatch_publisher_content”:“entry_modify c:\\ apps \\ fmeserver \\ temp \\ sample_file.txt”,
“dirwatch_publisher_action”:“修改”,
"fns_type": "dirwatch_publisher"
}
添加文件时
{
“dirwatch_publisher_path”:“c:\\ apps \\ fmeserver \\ temp \\ sample_file.txt”,
"dirwatch_publisher_content": "ENTRY_CREATE C:\\apps\\FMEServer\\Temp\\sample_file.txt",
"dirwatch_publisher_action": "CREATE",
"fns_type": "dirwatch_publisher"
}