Expand my Community achievements bar.

SOLVED

Enabling Asynchronous Support in Sling Servlet/OSGi Service for Parallel Processing of Multiple APIs

Avatar

Level 4

I'm working on a task where I need to process data from 3-4 third-party APIs asynchronously, or in parallel, and present this data in JSON format via a Sling servlet to the front end. Could anyone provide some guidance on how to enable asynchronous support in a Sling servlet or an OSGi service?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
2 Replies

Avatar

Correct answer by
Community Advisor

Avatar

Employee Advisor

Hi,

 

To enable asynchronous processing in a Sling servlet or OSGi service:

  1. Use OSGi Declarative Services (DS) with @reference to SlingJobExecutor for async logic.