斯潘8
span4
FME服务器通知服务允许创建发布-一种通过支持的协议从客户端接收内容的方法。This content is delivered as a notification to a topic.出版物的例子可能是收到的电子邮件,目录监视,SQS.这些发布包含通知新事件的逻辑。
If you have a client or dataset that isn't supported as a publication in FME,您可以创建一个工作区,并安排它以所需的间隔在FME服务器上运行。The workspace can then be used to send a notification to trigger a subscription (this could be another workspace to do processing).
To build a workspace that can check the state of a system or dataset,检查FME工作台是否支持数据格式或通信方法。
如果要检查数据集的更改或新功能,数据集是否有任何字段包含有关何时更改数据的信息,例如,a timestamp.
If the dataset has no way of identifying change,do you want to keep a copy of the data for comparison (caching) or just process the whole dataset?
有了数据缓存,data size and storage may be a consideration.If you have a large dataset,将两组数据读取到工作区进行更改检测可能会增加工作区运行时和内存使用。您还需要足够的空间来存储数据的副本。
Some 亚搏在线workflows may need an up to date set of data (eg a database table of current data),in this case you will already have a dataset to compare against,并且不需要重复的变更检测。如果您的工作流正亚搏在线在读取数据集并发布通知(例如,an email notification or SMS) based on new data or change,and not storing data,this may require data caching.
The ChangeDetector transformer can be used to compare two sets of data.
如果以支持SQL查询的格式缓存或存储数据,这可以节省时间,不需要FME读取整个数据集,only features where two values differ.
在这种情况下,a CARTO dataset of air quality needs to be kept up to date.The current air quality values are retrieved from a JSON data feed,写在卡通片上在地图上可视化。
有几种方法可以做到这一点:
ChangeDetector:
在此工作区中,the existing CARTO data is being read in,as well as the JSON air quality data feed.
两个数据集都通过changedetector传递,matching the data on the UUID.已添加的任何功能都将发送到卡通作者以更新数据集。
FeatureReader:
This workspace is getting the same output as using the ChangeDetector by using a FeatureReader.FeatureReader连接到Carto数据集,but will only read in requested features.In this case this is specified by a WHERE clause:
@value(uuid)=“uuid”和@value(aqi)!=“AQI”
The FeatureReader is looking for features where the UUID matches,但是空气质量指数是不同的。When these features are read in there will be a conflict between air quality index values,所以FeatureReader设置为“使用启动器”,taking the most current air quality index value and sending it the CARTO writer to update the dataset.
SQLExecutor:
One step further is to use the SQLExecutor to identify features in the CARTO dataset where the air quality index value differents from the JSON data feed,并通过SQL进行更新。
UPDATE aqdata SET aqi='@Value(aqi)' WHERE uuid=@Value(uuid) AND @Value(aqi) != "aqi"
如果您的数据有时间戳,您可以使用它来比较数据是更新的还是自上次运行工作区以来更新的。
If you have regular schedules you can use the new DateTimeCalculator to determine if a timestamp is newer based on a time interval.
If there's a chance that your job may be delayed in running resulting in inconsistent time intervals,您可以记录工作区上次运行时间。This can be on stored on FME Server,to be read in and updated every time the workspace runs.
在本例中,工作区被分成两个部分。第一部分读取工作区的最后一次运行时,and passes that timestamp to the other half of the workspace using a VariableSetter and VariableRetriever.
输入数据是温哥华道路工程的一个原子饲料,包含更新的时间戳。The difference between the workspace runtime and the data update is calculated.Any interval values greater than 0 are new scheduled roadworks or updated existing ones,and these can be filtered for processing or notifying.
将工作区发布到FME服务器后,可以将其设置为按计划运行。
The Schedules tab (on the left hand side in FME 2017) will bring up a list of existing schedules,显示有关计划以及是否已启用的信息。
Creating a new schedule allows you to enter a name,计划的类别和说明。The recurrence can be set to run on an interval,once or based on a CRON expression for more complex scheduling.
After the correct workspace has been selected,可以应用更多设置。通知有关工作成功或失败的主题,expand the Notifications view.
In 2017 some additional properties can be set on schedules,such as ‘Run Until Cancelled',“排队作业到期时间”和“正在运行作业到期时间”。
© 2019 亚搏在线Safe Software Inc |Legal