You are here: Reference Manual > FME Server Services > Notification Service > Subscribers > Workspace Subscriber

Workspace Subscriber

The workspace subscriber subscribes an FME Desktop 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 Server, and should be equipped to receive JSON-formatted notifications using readers, writers, or transformers.

Note: Support for the workspace subscriber in the FME Server REST API begins in version 3 (REST v3), available with the FME Server 2016 release. The workspace subscriber is not supported in earlier versions of the FME Server REST API.

Configuring the Subscriber

  1. In the FME Server Web User Interface, click Create Notification. Alternatively, select Manage > Notifications. Select the Subscriptions tab and click New.
  2. Provide a name for the Subscription
  3. Specify the topics you want to subscribe to using the drop-down selector, or click Select All if you want to subscribe to all available topics.
  4. In the Protocol drop down menu, select Workspace.
  5. Repository: Specify the repository in which the workspace resides.
  6. Workspace: Specify the workspace you want to subscribe.
  7. If the specified workspace has any published parameters, configure the settings you desire when the workspace runs.
  8. Notification Message Mapping: If any published parameters include specifying source datasets, you can pass one of them to the workspace as a new published parameter of the specified name. When the workspace runs, this published parameter is populated with the path to the source dataset. This new published parameter can be used elsewhere in the workspace that may require access to the source data. To forgo creating a new published parameter, select Do not map to a reader published parameter.
  9. Note: The file path to the dataset that populates the new published parameter is also written to a .json file in the Temp Resources folder, and is passed to the FME_TOPIC_MESSAGE workspace parameter.

  10. Configure the Advanced Settings, as desired. These settings affect all jobs that are run by this workspace, when triggered by the subscriber:
  11. Job Priority (optional) – The priority of the job that is run by the workspace.

    Job Routing Tag (optional) - To associate the job with a specific FME Engine, specify the name of the job routing tag associated with that engine. For example, if Engine 1 is configured with the "utility" tag in the FME Server configuration file, as TM_ENGINE_1=engine1:utility, specify utility. For more information about job routing, see Configuring Job Routing.

    Queued Job Expiry Time (optional) - The length of time, in seconds, 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.

    Run Till Cancelled (optional) - If checked, the job runs continuously, even after a server shutdown or crash, until it is explicitly canceled.

  12. Click OK.

Monitoring 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.

To configure a notification on success or failure of a workspace subscriber, first use the successtopics and failuretopics methods of the FME Server REST API to assign topics to notify on success or failure, respectively.

Note: The successtopics and failuretopics methods of the FME Server REST API are currently supported only with workspace subscribers. They are not supported with any other type of publisher or subscriber.

Next, configure a subscription to receive the notification. (This can be done either in the REST API or in the Web User Interface.) 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.