FME Flow: 2024.2
FME Workspace Subscriber
The FME workspace subscriber subscribes an FME Form workspace to a Notification Service topic. The specified workspace runs each time it receives a notification from the specified topic. The workspace must be already uploaded to FME Flow. To use the contents of the notification in the workspace, specify a workspace published parameter to obtain its data from the notification. Alternatively, use readers, writers, or transformers that are equipped to receive JSON-formatted notifications.
Configuring the Subscriber
- In the FME Flow Web User Interface, select Notifications > Subscriptions, and click New.
- Provide a Name for the Subscription
- In the Protocol drop down menu, select FME Workspace.
-
Specify the Topics you want to subscribe to using the drop-down selector. To create a topic and use it right away, click +.
- Repository: Specify the repository in which the workspace resides.
- Workspace: Specify the workspace you want to subscribe.
- If the specified workspace has any published parameters, configure the settings you desire when the workspace runs.
- Get Value from Topic Message: This setting applies to any published parameters that represent a source file. When checked, the notification contents are written to a file, and the published parameter obtains its data from the file.
- Send Result Data in Success Topic Message: This setting applies to any published parameters that represent a destination file. When checked, the published parameter's results are written to an output file, which can be parsed as XML, JSON, or text. The contents of the file are included in the notification that is sent to the topic specified by Post to Topic on Success (below).
If the notification contains a subscriber_content keyword, the value is written to the file without any parsing. This approach is a good way to send any arbitrary notification content to a workspace. Otherwise, the full notification is parsed and written to the file in JSON format.
A common practice is to expose a Text File or JSON reader's source dataset as a published parameter. When checked, the feature(s) produced by the reader are available through the notification contents, or they can be read in a transformer such as the AttributeFileReader.
Note Notifications are written to the System > temp > subscriptions folder in Resources. In the workspace, the notification can also be accessed through the FME_TOPIC_MESSAGE workspace parameter.Note The output file is written to the System > temp > subscriptions folder in Resources. - Configure topics for Success/Failure notifications, as desired. For more information, see Monitoring FME Workspace Subscribers below.
- Configure the Advanced Settings, as desired. These settings affect all jobs that are run by this workspace, when triggered by the subscriber:
- Job Queue (optional): The queue in which to run the job. The specified queue overrides the queue that would otherwise be assigned based on Queue Control job routing rules. If not specified, job routing rules apply. To view the queues to which FME Engines are assigned, open the Engines page.
- Queued Job Expiry Time (optional): The length of time after which a job that is waiting in queue does not execute. If the job does not execute before this time is reached, it remains in the queue until it is ready to execute, but execution is not attempted. This directive is useful for time-sensitive jobs that you do not want to run after the specified time is exceeded.
- Running Job Expiry Time (optional): The time a job will remain in the running state. This directive is used to ensure that a job does not hang and block an FME Engine indefinitely. The minimum allowable value is 1.
- Run Until Cancelled: If checked, the job runs continuously, even after a server shutdown or crash, until it is explicitly canceled.
- Click OK.
Monitoring FME Workspace Subscribers
You can monitor the success or failure of workspace subscribers by publishing notifications to topics when any of the following occurs:
- A workspace subscriber successfully receives a notification from a topic.
- A workspace subscriber fails to receive a notification from a topic.
After specifying topics, you must configure a subscription to receive the notification. To process the notification in the message body of the subscription, use the keywords in the JSON template that is generated for each type of notification, as follows:
Subscriber Failure Notification Template
{
"subscription" : <subscriptionName>,
"status" : "failure",
"msg" : <failureMsg>
}
Subscriber Success Notification Template:
{
"subscription" : <subscriptionName>,
"status" : "success",
"msg" : <successMsg>
}
For an example of how to configure an SMTP Email Subscriber using notification template keywords in the email message body, see Email Template Language.
For more information, see Monitoring FME Flow Events from Topics.