Question

API job completed notification


Hello the support team.

I am planning to call a FME workbench on our FME server and get the response back. The request will be passed to the FME server from a web application which uses .Net. In the meanwhile, it is not clear how the processing time is handled at the client side. If the client pass a job to the FME server and getting the response takes 10 min, how this waiting time should be handled? What kind of parameters (response) from FME server tell the developer about the result? Is there any callback from the server or any other acknowledgment/timing/triggering mechanism?

Many thanks

Mohsen


8 replies

Userlevel 4

For jobs that can take longer than a few seconds I would recommend using an asynchronous mechanism:

  1. Submit job, retain job ID
  2. Poll status for job ID
  3. If job ID <> completed, go back to 2, else continue
  4. Do whatever you need

Let us know if you need something more specific.

Badge +22

Could you not set up a PUSH notification and have that triggered by the job completion?

Could you not set up a PUSH notification and have that triggered by the job completion?

 

Thank you @jdh I will give it a shot and keep you posted

For jobs that can take longer than a few seconds I would recommend using an asynchronous mechanism:

  1. Submit job, retain job ID
  2. Poll status for job ID
  3. If job ID <> completed, go back to 2, else continue
  4. Do whatever you need

Let us know if you need something more specific.

Hi David,

 

Thanks for your reply.

 

 

I do not think this approach (Step 2 and 3) is an ideal solution for my case as it creates an extra load on the application and it needs a timer. How often do I need to check the timer? every 5 sec, every 10 sec, every 30 sec? what about if I choose 30 sec and the job finishes in time 1, I have wasted 29 sec.

 

 

I am thinking of writing a file somewhere and subscribe to it in .Net, but again I am not happy with this as it depends on a third party tool ( A file server/file location). So, is there any publish/notification modules for notifying a webpage/.Net function in FME directly?

 

 

 

Could you not set up a PUSH notification and have that triggered by the job completion?

@jdh

 

I came to this post, Is this a secure mechanism especially for a web application face public ?

 

https://www.tpeczek.com/2017/12/push-notifications-and-aspnet-core-part.html

 

 

I have found this one too, about 4 years old, not sure if there was an improvement.

 

https://dl.acm.org/citation.cfm?id=2660302

 

 

However, Based on the first link,

 

"This means that if such URL would leak, other parties would be able to send a push message to related subscription. This is why an additional mechanism has been introduced to limit the potential senders. This mechanism is Voluntary Application Server Identification (VAPID), details of which I'm going to describe in second post. What is important now is that VAPID requires Application Server Keys (public and private key pair)."

 

 

There should be a public and private key, Does FME have these?

 

Based on this:

 

http://docs.safe.com/fme/2018.1/html/FME_Server_Documentation/Content/ReferenceManual/HTTPPushSubscriber.htm

 

 

or maybe just simpler, if I use push notification in FME, Does this come with any serious security risk that I should be aware of?

 

 

Sorry if I am asking too much questions.

 

 

I have noticed that FME also has Amzon SNS, and I have seen this for .NET, and we have our server in AWS, Should be a secure and reliable alternative approach, what do you reckon ?
Badge +22
@jdh

 

I came to this post, Is this a secure mechanism especially for a web application face public ?

 

https://www.tpeczek.com/2017/12/push-notifications-and-aspnet-core-part.html

 

 

I have found this one too, about 4 years old, not sure if there was an improvement.

 

https://dl.acm.org/citation.cfm?id=2660302

 

 

However, Based on the first link,

 

"This means that if such URL would leak, other parties would be able to send a push message to related subscription. This is why an additional mechanism has been introduced to limit the potential senders. This mechanism is Voluntary Application Server Identification (VAPID), details of which I'm going to describe in second post. What is important now is that VAPID requires Application Server Keys (public and private key pair)."

 

 

There should be a public and private key, Does FME have these?

 

Based on this:

 

http://docs.safe.com/fme/2018.1/html/FME_Server_Documentation/Content/ReferenceManual/HTTPPushSubscriber.htm

 

 

or maybe just simpler, if I use push notification in FME, Does this come with any serious security risk that I should be aware of?

 

 

Sorry if I am asking too much questions.

 

 

I have noticed that FME also has Amzon SNS, and I have seen this for .NET, and we have our server in AWS, Should be a secure and reliable alternative approach, what do you reckon ?
That's beyond my realm of expertise. You're probably best off addressing security concerns to safe software directly.

 

For jobs that can take longer than a few seconds I would recommend using an asynchronous mechanism:

  1. Submit job, retain job ID
  2. Poll status for job ID
  3. If job ID <> completed, go back to 2, else continue
  4. Do whatever you need

Let us know if you need something more specific.

Hi David, seems this is the easiest way, although possibly not the best one. I am calling FME in an Ajax function, which calls a function on the server side. This called function on the server side subscribes to an email event to triger a function when an email receives. (FME sends an email upon completion). But the difficulty is that I cannot call a client function to show the result to the user when an email receives (maybe there is no way). I also do not want to call that function (which submits the jop to FME server) inside javascript (client) as this exposes security risk to our FME server. up voted. Thanks again.

For jobs that can take longer than a few seconds I would recommend using an asynchronous mechanism:

  1. Submit job, retain job ID
  2. Poll status for job ID
  3. If job ID <> completed, go back to 2, else continue
  4. Do whatever you need

Let us know if you need something more specific.

 

@david_r @daleatsafe

 

Unfortunately cannot up-vote, could you please sort this out, Thanks in advance

 

 

Reply