Add more debug logging
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/notifications/NewJobSender.java b/src/main/java/org/apache/sling/event/impl/jobs/notifications/NewJobSender.java
index dc16be2..668508d 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/notifications/NewJobSender.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/notifications/NewJobSender.java
@@ -76,6 +76,7 @@
properties.put(ResourceChangeListener.PATHS, this.configuration.getLocalJobsPath());
this.listenerRegistration = bundleContext.registerService(ResourceChangeListener.class, this, properties);
+ logger.debug("Registered resource event listener for {}", this.configuration.getLocalJobsPath());
}
/**
@@ -88,14 +89,15 @@
this.listenerRegistration.unregister();
this.listenerRegistration = null;
}
+ logger.debug("Deactivating resource event listener");
}
@Override
public void onChange(final List<ResourceChange> resourceChanges) {
for(final ResourceChange resourceChange : resourceChanges) {
- logger.debug("Received event {}", resourceChange);
+ final String path = resourceChange.getPath();
- final String path = resourceChange.getPath();
+ logger.debug("Received event {} : {}", resourceChange.getType().name(), path);
final int topicStart = this.configuration.getLocalJobsPath().length() + 1;
final int topicEnd = path.indexOf('/', topicStart);
@@ -109,12 +111,13 @@
properties.put(NotificationConstants.NOTIFICATION_PROPERTY_JOB_ID, jobId);
properties.put(NotificationConstants.NOTIFICATION_PROPERTY_JOB_TOPIC, topic);
- // we also set internally the queue name
+ // we also set internally the queue name
final String queueName = this.configuration.getQueueConfigurationManager().getQueueInfo(topic).queueName;
properties.put(Job.PROPERTY_JOB_QUEUE_NAME, queueName);
final Event jobEvent = new Event(NotificationConstants.TOPIC_JOB_ADDED, properties);
// as this is send within handling an event, we do sync call
+ logger.debug("Sending event {} : {}", topic, jobId);
this.eventAdmin.sendEvent(jobEvent);
}
}
diff --git a/src/main/java/org/apache/sling/event/impl/jobs/queues/QueueManager.java b/src/main/java/org/apache/sling/event/impl/jobs/queues/QueueManager.java
index 11f24a9..40edb37 100644
--- a/src/main/java/org/apache/sling/event/impl/jobs/queues/QueueManager.java
+++ b/src/main/java/org/apache/sling/event/impl/jobs/queues/QueueManager.java
@@ -242,6 +242,7 @@
}
}
if ( queue != null ) {
+ logger.debug("Starting queue {}", queueInfo.queueName);
if ( !isNewQueue ) {
queue.wakeUpQueue(topics);
}
@@ -406,6 +407,7 @@
public void handleEvent(final Event event) {
final String topic = (String)event.getProperty(NotificationConstants.NOTIFICATION_PROPERTY_JOB_TOPIC);
if ( this.isActive.get() && topic != null ) {
+ logger.debug("Received event {}", topic);
final QueueInfo info = this.configuration.getQueueConfigurationManager().getQueueInfo(topic);
this.start(info, Collections.singleton(topic));
}