Question

What is the FME Server Automation equivalent to using old Notification with "Get Value from Topic Message" ?

  • 12 October 2022
  • 3 replies
  • 1 view

Badge

I have a legacy Notification set up with Publications, Subscription and Topic. Trigger (publication) is an email that publishes to topic. A workspace subscribed this then "Get the Value from Topic Message".

 

In order to work with O365/modern authentication in Server 2022, I'm having to re-do this as a new style automation. I have the email part figured out. But whether I have my next 'Action' (my workspace) parsing the incoming parameter "email.body" or the "Event as JSON", I cannot get this to work as before.

 

The existing old-style solution expected input in this format:

{
"imap_publisher_content{0}": "  ",
"fns_type": "imap_publisher",
"imap_publisher_sent": "   ",
"imap_publisher_from": "   ",
"imap_publisher_subject": "   ",
"imap_publisher_content_type{0}": "TEXT/PLAIN; charset=ISO-8859-1",
"imap_publisher_received": "   ",
"imap_publisher_to": "   "
}

"Event As JSON" seems to feed me more JSON than necessary. Is it really necessary, as this thread suggests, to go back to using Topics, or is there some tweak needed that I' missing? Thanks.


3 replies

Badge

Okay, I have gone back to trying this using a topic as go-between. The IMAP email trigger works and writes the email info to a JSON file here:

..\resources\system\temp\subscriptions

The format (keys) are different from the original setup I listed in the initial post. Instead of :

"imap_publisher_to"

 

before I am now seeing:

 

"email.to"

 

So I've adjusted my FMW to map those attribute names back to what they were in order not to have to change the downstream tail of the FWM. When I take the brand new JSON output file "produced by the topic" and manually feed it into my workbench in Desktop. Everything runs beautifully now.

 

But when I create an automation with  "FME Server Topic (Notified)" as trigger and try to pick up the JSON by selecting to use "Event as JSON", the workspace on the server find the file on the server but now parses the JSON line by line assuming each line to be a file and erroring out 100's of times.

What am I doing wrong? This has got to be a wrong setting somewhere, a tweak in how to read JSON? Help! 

 

Badge

Looks like the JSON parsing trips over whitespace in some values... could this be some encoding issue? I read FME Server 2022 switching to UTF-8 only.

Badge

Ended up tweaking the first part of my workspace, replacing the single User Parameter for JSON input with a number of new parameters for all relevant JSON keys and picking them up with a Parameter Fetcher, then hooking all this into the individual values coming through from the IMAP trigger email event. Thanks to @siennaatsafe​ for some coaching on how to get there quickly. 😀

Reply