[
https://issues.apache.org/jira/browse/SLING-5645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15263913#comment-15263913
]
Ian Boston commented on SLING-5645:
-----------------------------------
Code has now been tested starting jobs inside an AEM 6.2 GA instance by adding
the following feature to a crankstart setup
{code}
[feature name=sling.extensions.jobs]
[artifacts]
#com.google.code.gson/gson/2.2.4
org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/1.0.1
org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1
org.ow2.asm/asm/4.1
com.google.guava/guava/16.0.1
org.apache.commons/commons-pool2/2.4.2
org.apache.sling/org.apache.sling.mom/0.0.1-SNAPSHOT
org.apache.sling/org.apache.sling.jobs/0.0.1-SNAPSHOT
org.apache.sling/org.apache.sling.amq/0.0.1-SNAPSHOT
org.apache.sling/org.apache.sling.jobs-it-services/0.0.1-SNAPSHOT
org.apache.sling/org.apache.sling.junit.core/1.0.10
[configurations]
# Configure a queue to listen to the queue used in the IT Services components.
org.apache.sling.jobs.impl.JobQueueConsumerFactory
queue-name="org/apache/sling/jobs/it/services"
{code}
And using the following JSP Fiddle to queue some jobs
{code}
<%@include file="/libs/foundation/global.jsp"%><%
%><%@page session="false" contentType="text/html; charset=utf-8"
pageEncoding="UTF-8"
import="org.apache.sling.api.resource.*,
java.util.*,
javax.jcr.*,
com.day.cq.search.*,
com.day.cq.wcm.api.*,
com.day.cq.dam.api.*,
org.apache.sling.jobs.*,
com.google.common.collect.*"%><%
// This is an AEM Fiddle that runs some jobs.
JobManager jobManager = sling.getService(JobManager.class);
for ( int i = 0; i < 100; i++ ) {
Job job = jobManager.newJobBuilder(
Types.jobQueue("org/apache/sling/jobs/it/services"),
Types.jobType("treadding/asyncthreadpoolwithbacklog"))
.addProperties(
ImmutableMap.of("jobtest", (Object) "jobtest"))
.add();
%>Added Job <%= job.getId() %><br/><%
}
%>
{code}
> Provide a Jobs API and implementation suitable for widely distributed job
> processing.
> -------------------------------------------------------------------------------------
>
> Key: SLING-5645
> URL: https://issues.apache.org/jira/browse/SLING-5645
> Project: Sling
> Issue Type: New Feature
> Reporter: Ian Boston
> Assignee: Ian Boston
>
> This issue is to track work on a proof of concept to create a Jobs API and
> implementation that will work in a distributed environment where the job
> submitters and job consumers are not necessarily in the same JVM or in the
> same Sling cluster.
> Work is being done in a branch at
> https://github.com/ieb/sling/tree/jobs_28/contrib/extensions/jobs
> Since the implementation needs supporting APIs/Capabilities not already
> present in Sling. There are some sub-tasks associated with this issue to
> address those.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)