Hi,
I'm trying to implement the new job system using a recent sling build.
org.apache.sling.event is at 3.3.1-SNAPSHOT. (updated this morning)
What I'm doing is very similar to the example at the sling website. And I can
see my events being created under the /var/eventing/jobs/unassigned node, so
creating the events seems to be working, but my consumer just isn't consuming
them.
Here's how I create them:
jobManager.addJob(DatastoreGCService.TOPIC_DATASTORE_GC_REQUESTED,
DatastoreGCService.DATASTORE_GC_REQUESTED_JOB_PROPERTIES);
TOPIC_DATASTORE_GC_REQUESTED = "com/astracorp/core/datastore/gc/requested";
DATASTORE_GC_REQUESTED_JOB_PROPERTIES = new HashMap<String,Object>();
Here's what my consumer looks like:
@Component(enabled = true, immediate = true, metatype = true)
@Service(value = JobConsumer.class)
@Property(name = JobConsumer.PROPERTY_TOPICS, value =
{DatastoreGCService.TOPIC_DATASTORE_GC_REQUESTED})
public class DatastoreGCHandler implements JobConsumer {
public static final Logger LOGGER =
LoggerFactory.getLogger(DatastoreGCHandler.class);
@Override
public JobResult process(final Job job) {
LOGGER.debug("process job called");
return null;
}
}
The consumer is listed in the services as:
[org.apache.sling.event.jobs.consumer.JobConsumer]
component.id 136
component.name com.astracorp.engine.commons.handlers.DatastoreGCHandler
job.topics com/astracorp/core/datastore/gc/requested
Service PID com.astracorp.engine.commons.handlers.DatastoreGCHandler
Everything looks fine to me but it's just not consuming. Am I missing
something? I notice that some components are not running, but I'm not sure
which is required.
org.apache.sling.event.impl.jobs.deprecated.JobStatusProviderImpl : registered
org.apache.sling.event.impl.jobs.tasks.HistoryCleanUpTask : registered
org.apache.sling.event.jobs.QueueConfiguration : unsatisfied (probably needs a
config)
Rob