diff --git a/pom.xml b/pom.xml
index 6ec810e..5ac41cb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
com.americanexpress.unify.flowret
unify-flowret
- 1.4.0
+ 1.4.1
jar
unify-flowret
diff --git a/readme.md b/readme.md
index 6332ceb..8543fc3 100644
--- a/readme.md
+++ b/readme.md
@@ -20,7 +20,7 @@ Flowret is available as a jar file in Maven central with the following Maven coo
````pom
com.americanexpress.unify.flowret
unify-flowret
-1.4.0
+1.4.1
````
---
diff --git a/src/main/java/com/americanexpress/unify/flowret/Flowret.java b/src/main/java/com/americanexpress/unify/flowret/Flowret.java
index 7fef9a5..b2d1cb2 100644
--- a/src/main/java/com/americanexpress/unify/flowret/Flowret.java
+++ b/src/main/java/com/americanexpress/unify/flowret/Flowret.java
@@ -21,10 +21,7 @@
import com.americanexpress.unify.flowret.CONSTS_FLOWRET.DAO;
import com.americanexpress.unify.jdocs.JDocument;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;
/*
* @author Deepak Arora
@@ -86,11 +83,22 @@ public static void init(int maxThreads, int idleTimeout, String typeIdSep) {
}
public static void init(int maxThreads, int idleTimeout, String typeIdSep, String errorWorkbasket) {
+ init(maxThreads, idleTimeout, typeIdSep, errorWorkbasket, null);
+ }
+
+ public static void init(int maxThreads, int idleTimeout, String typeIdSep, String errorWorkbasket, ThreadFactory threadFactory) {
Flowret am = instance();
am.maxThreads = maxThreads;
am.idleTimeout = idleTimeout;
BlockOnOfferQueue q = new BlockOnOfferQueue(new ArrayBlockingQueue<>(am.maxThreads * 2));
- am.es = new ThreadPoolExecutor(am.maxThreads, am.maxThreads, am.idleTimeout, TimeUnit.MILLISECONDS, q, new RejectedItemHandler());
+
+ if (threadFactory == null) {
+ am.es = new ThreadPoolExecutor(am.maxThreads, am.maxThreads, am.idleTimeout, TimeUnit.MILLISECONDS, q, new RejectedItemHandler());
+ }
+ else {
+ am.es = new ThreadPoolExecutor(am.maxThreads, am.maxThreads, am.idleTimeout, TimeUnit.MILLISECONDS, q, threadFactory, new RejectedItemHandler());
+ }
+
DAO.SEP = typeIdSep;
am.errorWorkbasket = errorWorkbasket;
ERRORS_FLOWRET.load();