0

In my website I have a form and which submits data to third party website. that api is available some time and not available some time. I need to create a queue mechanism to insert failed api calls and show them in admin panel.

Once admin wants to process the queue then that data needs to be resubmit to the third party site.

I need to know how to setup a cron job for the same , if we have more records then we can run cron for every 10 mins.

Any suggestions? I am new to this drupal8 queues.

  • Hi, thank you for asking this. I thought that the Queue API was fairly well documented on drupal.org/docs/8/api (or even Drupal 7!), but to my surprise there isn't even a page after 4 years :(. Your best bet is to look at api.drupal.org and make a decision about whether you need to create a Queue Worker plugin (runs queue via Drupal's cron system) or inject into the queue manually (and create your own way of processing queue items). And then update your question with some approaches. At the moment I think this is too broad. – mradcliffe Oct 1 at 16:50
  • drupal.stackexchange.com/questions/54738/…, Despite it's title is not a really good related question here despite SE's algorithm because there aren't really any good answers, but the question in the title is what I'm getting at. – mradcliffe Oct 1 at 16:52
0

I think this is what you want:

'If any failure occurs, you can revert the item back to queue to process that again'

The queue API of Drupal 8 which is known as Queue Worker

http://www.tothenew.com/blog/how-to-implement-queue-workerapi-in-drupal-8/

  • Thanks for the link , i followed it and worked as charm. Now i want to send some response variable to DrupalSettings on api success .. Lets say if API is success then DrupalSettings will send "true" to refresh my quotes page. If API is not success then DrupalSettings will send "false". As we are calling API in controller file. How can i set these params to DrupalSettings? – user3463733 Oct 4 at 5:00
  • have a look at both state and configuration api – Daniel Oct 4 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.