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: This setting applies only to workspaces that contain readers capable of reading JSON text, such as the JSON reader or Text File reader, and the source dataset is a published parameter.
  9. Notification messages are written to a .json file in the Temp Resources folder. This setting allows you to select a published parameter (of type Filename (Existing)) to receive the name of that file. This parameter can then read the contents of the .json file into the workspace.

    The parameter can be linked to the source dataset parameter of a reader, or it can be used in a transformer such as the AttributeFileReader.

    To forgo passing the file name to a published parameter, select Does not map to a reader published parameter. The message can still be read because the .json file name is also written 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.

Workspaces that are run from the workspace subscriber generate success and failure notifications through these methods only. Notifications that are configured through the Job Submitter or Data Download services do not generate when a workspace is run from the workspace 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.