Author Message
Reegz
Joined: Dec 3, 2019
Messages: 24
Offline
Good day folks,

The services that our Speech application fetches information from are protected using OAuth. As a result, we have a need to periodically refresh the access token that our application uses when connecting to the API's.

What options are available to us within the OD world that would help us to achieve the need to schedule the execution of a specific set of methods?

Open to suggestions.

Thanks

massimo__croci
Joined: Jan 31, 2020
Messages: 518
Offline
Hi. I'm not aware of any specific option for that within AOD. Maybe (just an idea, I never tried) you can write a Java application that calls webservices and uses your methods. Then add to the crontab assuming a GNU/Linux server. Does it make any sense ?
Reegz
Joined: Dec 3, 2019
Messages: 24
Offline
Thank you for the suggestion. Was hoping for something that involved fewer moving parts but it could work if all else fails.

In the Spring Boot world we would use @Scheduled or in previous tech we would make use of the Quartz scheduler.

I've been trying to declare custom beans in web.xml but these are overwritten each time the Designer compiles the project. Is there a way to declare custom servlet mappings that won't be overwritten?

Also, and this I imagine might be a bug, when I select the Load on start up checkbox on a given servlet this results in an invalid mapping for the load-on-startup element within the web.xml in that the element does not contain a valid value. This then breaks the deployment of the application.
Reegz
Joined: Dec 3, 2019
Messages: 24
Offline
So to round this off, we ended up setting a servlet to loadOnStartUp and overwrote the init method to provide an implementation for kicking off a Quartz scheduler.

Works effectively enough. If you do follow this route, ensure that you overwrite the servlet's destroy method and stop the scheduler.
Go to:   
Mobile view