killbill-memoizeit

Details

diff --git a/entitlement/src/main/java/com/ning/billing/entitlement/engine/core/ApiEventProcessorBase.java b/entitlement/src/main/java/com/ning/billing/entitlement/engine/core/ApiEventProcessorBase.java
index c4e01dd..c5b9bd4 100644
--- a/entitlement/src/main/java/com/ning/billing/entitlement/engine/core/ApiEventProcessorBase.java
+++ b/entitlement/src/main/java/com/ning/billing/entitlement/engine/core/ApiEventProcessorBase.java
@@ -77,6 +77,11 @@ public abstract class ApiEventProcessorBase implements IApiEventProcessor {
         this.isProcessingEvents = true;
         this.nbProcessedEvents = 0;
 
+
+        if (config.isEventProcessingOff()) {
+            log.warn("KILLBILL ENTITLEMENT EVENT PROCESSING IS OFF !!!");
+            return;
+        }
         final ApiEventProcessorBase apiEventProcessor = this;
 
         synchronized (this) {
diff --git a/entitlement/src/main/java/com/ning/billing/entitlement/engine/core/Engine.java b/entitlement/src/main/java/com/ning/billing/entitlement/engine/core/Engine.java
index 4f4d7e7..fee014e 100644
--- a/entitlement/src/main/java/com/ning/billing/entitlement/engine/core/Engine.java
+++ b/entitlement/src/main/java/com/ning/billing/entitlement/engine/core/Engine.java
@@ -95,10 +95,6 @@ public class Engine implements IEventListener, IEntitlementService {
 
     @LyfecycleHandlerType(LyfecycleLevel.START_SERVICE)
     public void start() {
-        if (config.isEventProcessingOff()) {
-            log.warn("KILLBILL ENTITLEMENT EVENT PROCESSING IS OFF !!!");
-            return;
-        }
         apiEventProcessor.startNotifications(this);
     }
 
diff --git a/entitlement/src/main/resources/ddl.sql b/entitlement/src/main/resources/ddl.sql
index b26f4a2..7381a91 100644
--- a/entitlement/src/main/resources/ddl.sql
+++ b/entitlement/src/main/resources/ddl.sql
@@ -26,12 +26,13 @@ CREATE TABLE events (
 
 DROP TABLE IF EXISTS claimed_events;
 CREATE TABLE claimed_events (
+    id int(11) unsigned NOT NULL AUTO_INCREMENT,    
     sequence_id int(11) unsigned NOT NULL,    
     owner_id char(36) NOT NULL,
     hostname varchar(64) NOT NULL,
     claimed_dt datetime NOT NULL,
     event_id char(36) NOT NULL,
-    PRIMARY KEY(sequence_id)
+    PRIMARY KEY(id)
 ) ENGINE=innodb;