Forum Stats

  • 3,783,752 Users
  • 2,254,826 Discussions
  • 7,880,537 Comments

Discussions

Handle long requests in background in SaaS Extension

Madhavanand
Madhavanand Member Posts: 39 Red Ribbon
edited Nov 15, 2016 6:57AM in Java Cloud Service

Hi,

Application on JCS SX

Jdev Version: 11.1.1.7.1

We have a requirement where a request takes 30 mins to execute. we couldn't achieve it from front end. We expect that these need to be scheduled at backend.

We have seen a document on quartz scheduler. but not sure whether that resolves our purpose. Also its mentioned that asynchronous calls cannot be handled in saas extension.

Will such requirements come under asynchronous request handling?

Is there a way to handle such requests where user can continue with his work while the request will continue to run in background?

We are expecting some similar behavior as Schedule process in Fusion. Is there a way to achieve this?
Thanks in Advance,

Madhav.

Madhavanand

Answers

  • Bhuwanesh
    Bhuwanesh Member Posts: 55
    edited Sep 7, 2016 6:00AM

    Hi Madhav

    One way of doing it is you can create a wrapper application on top of quartz scheduler and then use the scheduler to schedule an API which does this background job.

    I do not think this requires asynchronous request handling, infact can you elaborate why and what exactly are you expecting as an asynchronous service?

    Also Fusion ESS kind of a utility is not available in JCS-SX flavor, it will only be available in JCS 12c. So you are better off creating your own scheduling UI if you want

    to give better look and feel for scheduling your behind the job API's

    Thanks

    Bhuwanesh

  • Madhavanand
    Madhavanand Member Posts: 39 Red Ribbon
    edited Sep 10, 2016 2:30AM

    Hi Bhuwanesh,

    Thanks for your reply. I have posted this at multiple places and my query looks deviated.

    Requirement:

    one of the requests in our application has to go through 1000's of records and write that data to a file. This request is expected to take around 30 mins. But application cannot handle it. So I thought of handling this request in background. I got a suggestion that we can use quartz. Even myself not sure on how it works. Can you suggest us a way of handling such requests?

    Thanks in Advance

    Madhav.

  • Bhuwanesh
    Bhuwanesh Member Posts: 55
    edited Sep 13, 2016 4:02AM

    Hi Madhav

    JCS-SX or any weblogic server supports quartz scheduler, its an open source library which is packaged into any kind of Java EE server. So you can use the quartz scheduler

    libraries and create a java program to kick start the scheduler. You can provide various schedules options as well using scheduler API's.

    You can get many examples of quartz scheduler in google, one of the good resources is Examples

    Hope this helps. Let me know if any other question comes to your mind.

    Bhuwanesh

    MadhavanandMadhavanand
  • oladslw
    oladslw Member Posts: 120 Bronze Badge
    edited Nov 15, 2016 6:54AM

    Quartz is similar to jasper libraries.. bottom line is, if this process is polling data from the database, it really doesn't need to sit within the web application. you could easily write a stored procedure within your database which you can consume in your application. the stored procedure simply accepts the parameters of your query, and executes a batch job or even run as a simple procedure execution. The result set can be compiled into an excel file as csv, and emailed to the user who initiated with job once completed. You can be more clever about it by having a custom table for notifications updated, so the user receives the document as blob download rather than as an email or both. This isn't complex

  • oladslw
    oladslw Member Posts: 120 Bronze Badge
    edited Nov 15, 2016 6:57AM

    Apex DB schema already provides you with email services and scheduling is as easy as abc

This discussion has been closed.