Question

FME Server - Push subscription dynamic target URL


Badge

When we first ran across the push subscriber it seems this could really help out across many different types of workflows and also an agnostic interface with many of our major business systems. Many rest based API's contain keys within the URI so in our case we would like a dynamic target URL based on content with the topic. Is it possible to pull elements out of the topic and represent them as variables in the configuration of the push subscription?

I have looked around and cannot find any documentation on how to use variables from the topic within the rest target URL?

Below is a simple example:

topic = { "activity": "180340", "attachment": "\\\\\\\\server\\\\share\\\\180340.pdf","emailReceived": "Fri May 25 13:37:12 PDT 2018"}

In the target url we would like to use the activity number & attachment. These will change with each notification, therefore we need a way to build dynamic target url's. Below is an example url with the activity number embedded in the URI.

https://host/rest/api/2/issue/180340/attachments

Thanks!


2 replies

Badge +2

Hi @richardsr

 

 

I'm not sure that the PUSH subscriber will do exactly what you're after.

 

 

What it might be worth doing instead, is building a workspace and using the Workspace Subscriber, rather than push.

 

 

The workspace will have a Reader (I think JSON - you may have to confirm this) and a HTTPCaller that will make the requests for you.

 

What you can do then, is set the Source Dataset to the FME_TOPIC_MESSAGE parameter, which is Location of the FME Server Notification Service message. This parameter is set only in workspaces that are run from an FME workspace subscriber. For more information, see FME Workspace Subscriber in the FME Server documentation.

 

 

Once you've read in that JSON file, you should be able to have activity, attachment, email received (based on your example topic message content) and then use those attributes to dynamically build your HTTP request in the HTTPCaller.

 

 

This might also be useful: http://docs.safe.com/fme/2018.1/html/FME_Server_Documentation/Content/ReferenceManual/FME-Workspace-Subscriber.htm
Badge

Thank you!

This was a helpful suggestion and it worked, however I did have to resort to using the python caller with a custom python script to build the http request. Really appreciate your insight into the Workspace caller. It is a little extra work but the hooks are their to accomplish the messaging which is exactly what we needed.

Reply