Springboot scheduler - pause/resume task - spring-boot

I've a Springboot scheduler (annotated with #Scheduled) which uploads a file to Amazon S3 bucket. Now, ask is to be able to pause/resume upload on demand.
My understanding is that since this scheduler uploads file in a separate thread, it may not be possible to achieve pause/resume functionality.
I've already looked into some options that provide client side solution using JS libraries/packages or AWS SDK but it requires complete rewrite of existing functionality. So, What are other possible options that can be implemented from backend with less amount of change including UI to pause/resume/track upload, if that's possible?

Related

Bot Framework Orchestrator create snapshots at runtime / Orchestrate between multiple KBs

I am creating a ChatBot using the Bot Framework SDK v4 with Orchestrator.
As per the docs, Orchestrator works by using a pretrained model to create a snapshot of .lu & .qna files, and then dispatches to the correct LUIS or QnAMaker service depending on user input by referring to the Orchestrator snapshot.
However, for my bot, which has several knowledge bases with several dozens of contributors this is a very tedious task. You have to export each knowledge base using the bf CLI via
bf qnamaker:kb:export -o filename.qna --kbId="mykbid" --qnaFormat
and then move the resulting .qna file into the CognitiveModels folder, then create the Orchestrator snapshot manually. Then I also have to redeploy the bot to Azure just to update the Orchestrator snapshot.
This means every time any knowledge base is updated I have to do this manually periodically in order to update the bot so that Orchestrator properly dispatches to the correct KB. I feel like this should be something that's automated during runtime. I don't see anywhere in the Docs a way to do this.
Since LUIS models aren't updated as regularly I thought that I could set the default case as the QnaMaker, so any unknown intents get mapped to QnAMaker by default and therefore the snapshot doesn't have to be updated as often. But the problem with that is if you have multiple QnAMaker KBs, there's no way to federate the KBs into a single QnAMaker endpoint (AFAIK; if it is possible this would solve my issue) so you have to rebuild Orchestrator snapshot to dispatch between different KB services as well.
Are there any suggestions on how to automate creating Orchestrator snapshots?
As far as I am aware, there is no automated method of accomplishing this. If everything you need to do is in the CLI, you could write a script to automate the task for you, and either run it as needed or use something like cron to run it automatically (assuming the machine running the script is on at the specified time).

Use Laravel Queue with Google Tasks on App Engine Standard

I'm running Laravel 6 on Google App Engine Standard and trying to make Laravel Queues work with Google Tasks natively.
Currently I'm creating (dispatching) and handling tasks with custom classes, but I would like to use Google task as native Laravel Queues, so I can call Job::dispatch() dispatch(new Job) and use Mail, Notification with Queueable. But unfortunately it is beyond my abilities and I can’t figure out how everything is interconnected in Laravel.
Using Google Cloud API, you can create multiple queues for different target applications, deployed on Google App Engine in either Standard or Flexible environment.(Check here)
Here you can find detailed instructions on how to associate your Laravel project with Google Cloud Tasks processing asynchronous Jobs.
-Basically, you will create a task queue with a “queue.yaml” file, to handle the Cloud Tasks.
-Before Creating the Task:
---Pass the route of the API and the payload object for the Task.
---Authenticate userID in payload.
-Build/Create the Task. Using the method demonstrated on the example, it will use the Google API to build a Cloud Task and pass it to the task queue.
-Create the API routes in api.php.
-Create a TaskController which will route the different API to the specific (associateApp()) function.

Integrating SharePoint online with external application using Microsoft Flow scheduler

I need to integrate an external application with SharePoint Online where i need to retrieve data on a daily basis.
Was thinking of implementing it as a Microsoft Flow scheduler and using HTTP REST API action . Is this the right way or is there any other way ?
Thanks in advance
Apart from it sounds rather like general question about some business process architecture, let's go through it:
i need to retrieve data on a daily basis.
That's ok and what MS Flow is widely used for. You can list items/folders, create new ones or delete them and get file content.
Was thinking of implementing it as a Microsoft Flow scheduler
This sounds like Reccurence trigger which runs an event at regular, customized time intervals.
using HTTP REST API action
Indeed, HTTP action allows you to invoke REST API. On the other hand When a HTTP request is received trigger allows you to start the flow from other flow/app.

Consume Hyperledger composer event in Angular Based Application which uses REST API

I am little new to UI freamework so please help me understand is there a way to consume an event if I have build the plain angular based app, which uses the composer rest api for UI (note: not a Node.js application)
Because as per documentation it says:
Node.js applications can subscribe to events from a business network by using the composer-client.BusinessNetworkConnection.on API call. Events are defined in the business network model file and are emitted by specified transactions in the transaction processor function file.
Redirection to blog or documentation link would be helpful.
We plan to expose events through the composer-rest-server however that work is not yet complete. See:
https://github.com/hyperledger/composer/issues/1177
Until that work is finished you will need to subscribe to events from within your Node.js express application and then publish them (via web sockets?) to your frontend.

Schedule CronJobs with the PHP Buildpack

For my PHP Web App I am using the PHP Buildpack. Now I would like to schedule a Tasks that should be triggered every month. Normally I would use CronJobs for that.
How can I achieve that within the Swisscom Application Cloud?
Swisscom App Cloud is based on Open Source Cloud Foundry
Upstream Cloud Foundry doesn’t have a feature equivalent to cron jobs (task scheduler). Stay tuned, I guess this feature will be soon implemented, because lots of people migrating from Heroku to CF. Heroku offers a cron job feature. Subscribe to Swisscom App Cloud Newsletter to read announcements.
There are workarounds for scheduling tasks, see Scheduling tasks on Cloud Foundry on blog.pivotal.io for a Ruby/Rake based example. Sorry for PHP I didn't found example code. There is no elegant solution! You need to implement yourself some kind of workaround. Would be great if you publish your code to GitHub.
If you need cron jobs only in data store, for example MariaDB offers Events.
Events are named database objects containing SQL statements that are
to be executed at a later stage, either once off, or at regular
intervals.
They function very similarly to the Windows Task Scheduler or Unix
cron jobs.
We had a simular issue. As written by #Fyodor, there is no native solution in Cloud Foundry. We did some research and found vendors like https://www.iron.io/.
Finally, we ended up with a very simple solution.
We expose all our background jobs via an https interface.
As we anyhow use Jenkins for CI/CD and it has lots of scheduling capabilities, we use our existing Jenkins to trigger these jobs via a simple cURL call to the HTTP endpoints.

Resources