Skip to main content

I followed this directory-watch-tutorial:

https://knowledge.safe.com/articles/31475/tutorial-fme-server-watch-publisher-2016.html

In my recent Version of FME-Server ( FME Server 2017.0.0.2 - Build 17280 - linux-x64 ) the directory watch does not work.

This is the error message:

I think the problem is that in the tutorial there is a step where the setting "Send Notification Data to Reader" is set to "somefile[textline]":

But in the recent version of FME you cant set this option:

Any idea how this problem could be solved?

Hi!

My first suggestion is to try and turn on "Merge Feature Type" on your reader (if it is not already). Example:

If that does not help I would suggest to start with a simple Workspace that logs the parameter "FME_TOPIC_MESSAGE" like this:

The message should point to a file different than "somefile.txt" when published and subscribed to.

Then you could use a "FeatureReader" reading that file afterwards.

/Ulf


Thanks for the suggestion.

I turned on the "Merge Feature Type" option but it did not solve the problem.

This is the output of the logger used in the simple Workspace you sketched above:

Attribute(encoded: utf-8) : `_FME_TOPIC_MESSAGE' has value `/opt/fmeserver/resources/system/temp/subscriptions/bb951070e14247cf9d89823889f9f56e.json'

 

For the next file it was a different json file, so it's not a static path I could read from:

 

Attribute(encoded: utf-8) : `_FME_TOPIC_MESSAGE' has value `/opt/fmeserver/resources/system/temp/subscriptions/eed34f989e324fa3b3aae9e452f18001.json'

This is how I do it, tested with FME Server 2017.0:

In your workspace that gets triggered by the Subscription, create a Text File reader, make sure to set it to read the entire file at once. Make sure that the file name is a published parameter (default). After the Text File reader you can introduce a JsonFlattener and e.g. a Logger to see what's going on.

Publish the workspace to FME Server.

When creating the Subscription, make sure that you check "Get value from topic message" for your published parameter (i.e. the filename for your Text File reader). Example:

0684Q00000ArKMAQA3.png

Trigger the workspace once by creating a file inside the watched directory and look in the job lob for the Logger output. Example:

0684Q00000ArKKKQA3.png

You can now expand on your workspace by exposing key attributes such as

dirwatch_publisher_action
dirwatch_publisher_path

Hope this helps.


Reply