فهرست منبع

1. 升级底层

liukx 3 سال پیش
والد
کامیت
8e7df1b7d7

+ 3 - 3
elab-core/src/main/java/com/elab/core/async/pruducer/ITaskProducer.java

@@ -20,7 +20,7 @@ public interface ITaskProducer {
      *
      * @param taskExecutor
      */
-    public void sendRealTimeQueue(RealTaskExecutor taskExecutor);
+    public boolean sendRealTimeQueue(RealTaskExecutor taskExecutor);
 
     /**
      * 发送异步实时消息
@@ -28,14 +28,14 @@ public interface ITaskProducer {
      * @param taskExecutor
      * @param taskStoreData
      */
-    public void sendRealTimeQueue(RealTaskExecutor taskExecutor, TaskStoreData taskStoreData);
+    public boolean sendRealTimeQueue(RealTaskExecutor taskExecutor, TaskStoreData taskStoreData);
 
     /**
      * 发送异步调度消息
      *
      * @param schedulingTaskExecutor
      */
-    public void sendSchedulingList(SchedulingTaskExecutor schedulingTaskExecutor);
+    public boolean sendSchedulingList(SchedulingTaskExecutor schedulingTaskExecutor);
 
     /**
      * 聚合运算

+ 14 - 16
elab-core/src/main/java/com/elab/core/async/pruducer/TaskProducer.java

@@ -45,12 +45,12 @@ public class TaskProducer implements ITaskProducer {
     }
 
     @Override
-    public void sendRealTimeQueue(RealTaskExecutor taskExecutor) {
-        sendRealTimeQueue(taskExecutor, null);
+    public boolean sendRealTimeQueue(RealTaskExecutor taskExecutor) {
+        return sendRealTimeQueue(taskExecutor, null);
     }
 
     @Override
-    public void sendRealTimeQueue(RealTaskExecutor taskExecutor, TaskStoreData taskStoreData) {
+    public boolean sendRealTimeQueue(RealTaskExecutor taskExecutor, TaskStoreData taskStoreData) {
         if (taskStoreData != null && taskStoreData.isSave()) {
             handAdd(taskStoreData);
         }
@@ -64,6 +64,7 @@ public class TaskProducer implements ITaskProducer {
                 logger.error("队列满了!");
             }
         }
+        return isConsumer;
     }
 
     private void handAdd(TaskStoreData taskStoreData) {
@@ -73,12 +74,9 @@ public class TaskProducer implements ITaskProducer {
     }
 
     public ThreadPoolExecutor getExecutor() {
-        return new ThreadPoolExecutor(5, 5,
-                0L, TimeUnit.MILLISECONDS,
-                new ArrayBlockingQueue<>(20));
+        return new ThreadPoolExecutor(5, 5, 0L, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<>(20));
     }
 
-
     @Override
     public Map<String, Object> reduce(List<?> calculateList, Function<List<?>, Map<String, Object>> function) {
         ThreadPoolExecutor executor = getExecutor();
@@ -98,9 +96,10 @@ public class TaskProducer implements ITaskProducer {
                 }
 
                 List<? extends List<?>> partitionList = Lists.partition(calculateList, 5);
-//                CompletableFuture<Map<String, Object>>[] listFuture = new CompletableFuture[batchCount];
+                //                CompletableFuture<Map<String, Object>>[] listFuture = new CompletableFuture[batchCount];
                 List<CompletableFuture<Map<String, Object>>> list = new ArrayList<>();
-                CompletableFuture<List<CompletableFuture<Map<String, Object>>>> listCompletableFuture = CompletableFuture.completedFuture(list);
+                CompletableFuture<List<CompletableFuture<Map<String, Object>>>> listCompletableFuture =
+                    CompletableFuture.completedFuture(list);
                 for (int i = 0; i < batchCount; i++) {
                     int partitionIndex = i;
                     list.add(CompletableFuture.supplyAsync(() -> {
@@ -108,8 +107,8 @@ public class TaskProducer implements ITaskProducer {
                         return apply;
                     }, executor));
                 }
-//                CompletableFuture<Void> completableFuture = CompletableFuture.allOf(listFuture);
-//                completableFuture.get();
+                //                CompletableFuture<Void> completableFuture = CompletableFuture.allOf(listFuture);
+                //                completableFuture.get();
 
                 for (int i = 0; i < list.size(); i++) {
                     CompletableFuture<Map<String, Object>> mapCompletableFuture = list.get(i);
@@ -120,8 +119,8 @@ public class TaskProducer implements ITaskProducer {
                             dataMap.put(K, V);
                         } else {
                             if (V instanceof List) {
-                                List mapList = (List) dataMap.get(K);
-                                mapList.addAll((Collection) V);
+                                List mapList = (List)dataMap.get(K);
+                                mapList.addAll((Collection)V);
                                 dataMap.put(K, mapList);
                             } else {
                                 dataMap.put(K, V);
@@ -137,9 +136,8 @@ public class TaskProducer implements ITaskProducer {
         return null;
     }
 
-
     @Override
-    public void sendSchedulingList(SchedulingTaskExecutor schedulingTaskExecutor) {
-        this.taskExecutorQueue.getSchedulingList().add(schedulingTaskExecutor);
+    public boolean sendSchedulingList(SchedulingTaskExecutor schedulingTaskExecutor) {
+        return this.taskExecutorQueue.getSchedulingList().add(schedulingTaskExecutor);
     }
 }

+ 52 - 23
elab-db/src/main/java/com/elab/core/dao/BasicBaseDao.java

@@ -1,5 +1,6 @@
 package com.elab.core.dao;
 
+import com.alibaba.druid.sql.SQLUtils;
 import com.alibaba.fastjson.JSON;
 import com.elab.core.bean.PageModel;
 import com.elab.core.dao.model.JdbcParamsModel;
@@ -755,34 +756,50 @@ public class BasicBaseDao implements ApplicationContextAware, InitializingBean {
         }
     }
 
+    /**
+     * SQL的后置触发器
+     *
+     * @param event   执行事件
+     * @param sqlId   SQL编号
+     * @param table   表名
+     * @param sql     SQL内容
+     * @param request SQL参数
+     * @param result  结果集
+     * @param time    耗时
+     * @param status  状态
+     */
     private void sqlPostCallBack(SqlCommandType event, String sqlId, String table, String sql, Object request,
         Object result, Long time, Integer status) {
-        if (this.sqlPostProcessorList != null && this.sqlPostProcessorList.size() > 0) {
-            for (int i = 0; i < sqlPostProcessorList.size(); i++) {
-                SqlResult sqlResult = new SqlResult();
-                sqlResult.setCommandType(event.name());
-                sqlResult.setSqlId(sqlId);
-                sqlResult.setTable(table);
-                sqlResult.setSql(sql);
-                sqlResult.setRequestParams(request);
-                sqlResult.setResult(result);
-                sqlResult.setTime(time);
-                if (result != null) {
-                    if (result instanceof int[]) {
-                        sqlResult.setAffectRows(((int[])result).length);
-                        sqlResult.setCommandType("batch_" + event.name());
-                    } else if (result instanceof Number) {
-                        if (event == SqlCommandType.INSERT) {
-                            sqlResult.setAffectRows(1);
-                        } else {
-                            sqlResult.setAffectRows((Integer)result);
+        try {
+            if (this.sqlPostProcessorList != null && this.sqlPostProcessorList.size() > 0) {
+                for (int i = 0; i < sqlPostProcessorList.size(); i++) {
+                    SqlResult sqlResult = new SqlResult();
+                    sqlResult.setCommandType(event.name());
+                    sqlResult.setSqlId(sqlId);
+                    sqlResult.setTable(table);
+                    sqlResult.setSql(sql);
+                    sqlResult.setRequestParams(request);
+                    sqlResult.setResult(result);
+                    sqlResult.setTime(time);
+                    if (result != null) {
+                        if (result instanceof int[]) {
+                            sqlResult.setAffectRows(((int[])result).length);
+                            sqlResult.setCommandType("batch_" + event.name());
+                        } else if (result instanceof Number) {
+                            if (event == SqlCommandType.INSERT) {
+                                sqlResult.setAffectRows(1);
+                            } else {
+                                sqlResult.setAffectRows((Integer)result);
+                            }
                         }
                     }
+                    sqlResult.setStatus(status);
+                    SQLPostProcess sqlPostProcess = sqlPostProcessorList.get(i);
+                    sqlPostProcess.callback(sqlResult);
                 }
-                sqlResult.setStatus(status);
-                SQLPostProcess sqlPostProcess = sqlPostProcessorList.get(i);
-                sqlPostProcess.callback(sqlResult);
             }
+        } catch (Exception e) {
+            logger.warn("SQL 后置处理器失败 : ", e);
         }
     }
 
@@ -815,7 +832,8 @@ public class BasicBaseDao implements ApplicationContextAware, InitializingBean {
             long time = System.currentTimeMillis() - start;
             sqlInvokeAfter(SqlCommandType.UPDATE, sqlId, table, sql, request, update);
             logger.debug(" SQL 执行耗时 : " + time);
-            sqlPostCallBack(SqlCommandType.UPDATE, sqlId, table, sql, request, update, time, 1);
+            sqlPostCallBack(SqlCommandType.UPDATE, sqlId, table, getFormatSQL(jdbcParamsModel), request, update, time,
+                1);
             isOk = true;
             return update;
         } finally {
@@ -825,4 +843,15 @@ public class BasicBaseDao implements ApplicationContextAware, InitializingBean {
         }
     }
 
+    private String getFormatSQL(JdbcParamsModel jdbcParamsModel) {
+        String sql = jdbcParamsModel.getSql();
+        try {
+            Object[] objects = jdbcParamsModel.getObjects();
+            return SQLUtils.format(sql, "MYSQL", Arrays.asList(objects));
+        } catch (Exception e) {
+            logger.warn("sql format error : " + e.getMessage());
+            return sql;
+        }
+    }
+
 }

+ 4 - 2
elab-db/src/main/java/com/elab/core/dao/IBaseDaoSupport.java

@@ -143,7 +143,8 @@ public interface IBaseDaoSupport<T> {
     public int[] batchInsertByMap(List<Map> list);
 
     /**
-     * 批量添加
+     * 根据对象批量修改;
+     * <p>这里需要注意的是即便传递进来的是null值也会被应用,最好新写SQL然后再应用。默认的SQL是涵盖所有字段,比如你对象传递,但是创建时间肯定是null的,那么也可能覆盖掉,请谨慎</p>
      *
      * @param list
      * @return
@@ -151,7 +152,8 @@ public interface IBaseDaoSupport<T> {
     public int[] batchUpdateByObject(List<T> list);
 
     /**
-     * 批量添加
+     * 根据Map批量修改,
+     * <p>这里需要注意的是即便传递进来的值为null也会被应用,最好新写SQL然后再应用。默认的SQL是涵盖所有字段,</p>
      *
      * @param list
      * @return

+ 1 - 1
elab-db/src/test/java/com.db.service/main/BasicBaseDaoCase.java

@@ -124,7 +124,7 @@ public class BasicBaseDaoCase {
         List<TTest> list = new ArrayList<>();
         for (int i = 1; i < 10; i++) {
             TTest test = new TTest();
-            test.setTime(new Date());
+            test.setTime(null);
             test.setId(i);
             list.add(test);
         }

+ 22 - 15
elab-db/src/test/java/com.db.service/main/BasicServiceCase.java

@@ -1,6 +1,8 @@
 package com.db.service.main;
 
 import com.db.service.ITestService;
+import com.db.service.dao.ITestDao;
+import com.db.service.impl.TestServiceImpl;
 import com.db.service.model.TTest;
 import com.elab.core.componts.ConcurrentTool;
 import com.elab.core.utils.RandomUtils;
@@ -18,6 +20,8 @@ import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
 
+import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -28,21 +32,22 @@ import java.util.List;
  * @email : liukx@elab-plus.com
  */
 @RunWith(SpringJUnit4ClassRunner.class)  //使用junit4进行测试
-@ContextConfiguration
-        ({"classpath:applicationContext-*.xml",})
+@ContextConfiguration({"classpath:applicationContext-*.xml",})
 @EnableTransactionManagement
 public class BasicServiceCase {
     private Logger logger = LoggerFactory.getLogger(getClass());
     @Autowired
     private ITestService testService;
 
+    @Autowired
+    private ITestDao testDao;
+
     @Autowired
     private JdbcTemplate jdbcTemplate;
 
     @Rule
     public ContiPerfRule rule = new ContiPerfRule();
 
-
     @Test
     public void testDeadLockUpdate() throws Exception {
         ConcurrentTool concurrentTool = new ConcurrentTool(10);
@@ -53,10 +58,10 @@ public class BasicServiceCase {
             return null;
         });
 
-//        concurrentTool.process(() -> {
-//            updateByExample1();
-//            return null;
-//        });
+        //        concurrentTool.process(() -> {
+        //            updateByExample1();
+        //            return null;
+        //        });
         System.out.println("处理结束");
         System.in.read();
     }
@@ -64,6 +69,7 @@ public class BasicServiceCase {
     private void updateTestById() {
         TTest test = new TTest();
         test.setLoveName("bbb" + RandomUtils.randomNum(5));
+        test.setCreated(null);
         test.setId(1);
         try {
             testService.updateById(test);
@@ -84,8 +90,8 @@ public class BasicServiceCase {
     }
 
     @Test
-    @PerfTest(invocations = 10000, threads = 10)
-    @Required(throughput = 1000, max = 1000)
+//    @PerfTest(invocations = 10000, threads = 10)
+//    @Required(throughput = 1000, max = 1000)
     public void insert() throws Exception {
         TTest test = new TTest();
         test.setName("某某某");
@@ -93,9 +99,9 @@ public class BasicServiceCase {
         test.setStatus("1");
         test.setUsername("测试的啊");
         int insert = testService.insert(test);
-//        String sql = "insert into t_test (username, name, sex, status, created, time, test_id, love_name)\n" +
-//                "        values ('某某某', '测试的啊', '男', '1', null, null, null, null)";
-//        jdbcTemplate.update(sql);
+        //        String sql = "insert into t_test (username, name, sex, status, created, time, test_id, love_name)\n" +
+        //                "        values ('某某某', '测试的啊', '男', '1', null, null, null, null)";
+        //        jdbcTemplate.update(sql);
     }
 
     @Test
@@ -112,18 +118,19 @@ public class BasicServiceCase {
         test.setStatus("1");
         test.setUsername("测试的啊");
         test.setId(10);
+        test.setTime(null);
         int result = testService.updateById(test);
-        System.out.println(result);
+//        int[] ints = testDao.batchUpdateByObject(Arrays.asList(test));
+//        System.out.println(Arrays.stream(ints).toArray());
     }
 
     @Test
     public void findByList() throws Exception {
         TTest test = new TTest();
-//        test.setUsername("test");
+        //        test.setUsername("test");
         test.setStatus("1");
         List<TTest> tTests = testService.selectByList(test);
         System.out.println(tTests.size());
     }
 
-
 }

+ 2 - 2
elab-db/src/test/resources/applicationContext-datasource.xml

@@ -15,9 +15,9 @@
 
     <bean id="mysqlDataSource" class="com.alibaba.druid.pool.DruidDataSource">
         <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
-        <property name="url" value="jdbc:mysql://192.168.0.13:3306/elab_db?characterEncoding=utf-8"/>
+        <property name="url" value="jdbc:mysql://192.168.0.11:3306/elab_db?characterEncoding=utf-8"/>
         <property name="username" value="root"/>
-        <property name="password" value="elab@123"/>
+        <property name="password" value="Elab@123"/>
         <property name="initialSize" value="50"/>
         <property name="maxActive" value="100"/>
         <property name="minIdle" value="1"/>

+ 4 - 0
elab-db/src/test/resources/sql/test-sql.xml

@@ -129,6 +129,10 @@
         update t_test set love_name=:loveName  where status = :status and name = :name
     </sql>
 
+    <sql id="updateByExample">
+        update t_test set love_name=:loveName  where status = :status and name = :name
+    </sql>
+
     <sql id="updateUserInfo">
         update c_user_info set updated = :updated, real_name = :realName,
         report_name = :reportName, visit_name = :visitName, validate_name = :validateName,

+ 4 - 4
elab-log/src/main/java/com/elab/log/ext/CatTaskProducer.java

@@ -22,8 +22,8 @@ public class CatTaskProducer extends TaskProducer {
     }
 
     @Override
-    public void sendRealTimeQueue(RealTaskExecutor taskExecutor) {
-        sendRealTimeQueue(taskExecutor, noSave());
+    public boolean sendRealTimeQueue(RealTaskExecutor taskExecutor) {
+        return sendRealTimeQueue(taskExecutor, noSave());
     }
 
     private TaskStoreData noSave() {
@@ -33,7 +33,7 @@ public class CatTaskProducer extends TaskProducer {
     }
 
     @Override
-    public void sendRealTimeQueue(RealTaskExecutor taskExecutor, TaskStoreData taskStoreData) {
+    public boolean sendRealTimeQueue(RealTaskExecutor taskExecutor, TaskStoreData taskStoreData) {
         //构建消息上下文
         Map<String, String> msgContextMap = CatCrossProcess.getMsgContextMap();
         if (taskStoreData == null) {
@@ -43,7 +43,7 @@ public class CatTaskProducer extends TaskProducer {
         // 构建消息串联执行器
         CatRealTaskExecutor catRealTaskExecutor = new CatRealTaskExecutor(TaskEnums.RealTime, taskExecutor,
                 taskStoreData);
-        super.sendRealTimeQueue(catRealTaskExecutor, taskStoreData);
+        return super.sendRealTimeQueue(catRealTaskExecutor, taskStoreData);
     }
 
 }

+ 2 - 2
elab-redis/src/test/java/com/elab/redis/spring/SpringDataTest.java

@@ -131,8 +131,8 @@ public class SpringDataTest extends RedisSpringBoot {
     @Test
     public void delKey(){
         List<String> delKeyList = new ArrayList<>();
-        delKeyList.add("user:userId:mobile:3250634");
-        delKeyList.add("user:userId:mobile:3258428");
+        delKeyList.add("user:userId:mobile:3234916");
+        //delKeyList.add("user:userId:mobile:3258428");
         Long delete = redisTemplate.delete(delKeyList);
         System.out.println(delete);
     }

+ 26 - 15
elab-spring/src/main/java/com/elab/spring/utils/ThreadProcessUtils.java

@@ -7,6 +7,8 @@ import com.elab.core.async.pruducer.ITaskProducer;
 import com.elab.log.ext.CatSupplier;
 import com.elab.spring.config.prop.ThreadPoolProperties;
 import com.elab.spring.config.prop.ThreadProperties;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.context.ApplicationContext;
@@ -24,7 +26,7 @@ import java.util.function.Supplier;
  * @Date 2020/11/18 15:51
  */
 public class ThreadProcessUtils implements ApplicationContextAware, InitializingBean {
-
+    private static Logger logger = LoggerFactory.getLogger(ThreadProcessUtils.class);
     private ApplicationContext applicationContext;
 
     private static ITaskProducer taskProducer;
@@ -53,10 +55,12 @@ public class ThreadProcessUtils implements ApplicationContextAware, Initializing
         this.applicationContext = applicationContext;
     }
 
-    public static void addRealTimeQueue(RealTaskExecutor taskExecutor, TaskStoreData taskStoreData) {
+    public static boolean addRealTimeQueue(RealTaskExecutor taskExecutor, TaskStoreData taskStoreData) {
         if (taskProducer != null) {
-            taskProducer.sendRealTimeQueue(taskExecutor, taskStoreData);
+            return taskProducer.sendRealTimeQueue(taskExecutor, taskStoreData);
         }
+        logger.warn("加入队列失败,taskProducer 为空!");
+        return false;
     }
 
     /**
@@ -91,7 +95,8 @@ public class ThreadProcessUtils implements ApplicationContextAware, Initializing
      * @return 阻塞
      * @throws Exception
      */
-    public static <U> CompletableFuture<U>[] supplyAsync(boolean isBlockResult, Long timeOutMs, Supplier<U>... supplier) throws Exception {
+    public static <U> CompletableFuture<U>[] supplyAsync(boolean isBlockResult, Long timeOutMs, Supplier<U>... supplier)
+        throws Exception {
         CompletableFuture<U>[] result = new CompletableFuture[supplier.length];
         for (int i = 0; i < supplier.length; i++) {
             CompletableFuture<U> completableFuture = supplyAsync(supplier[i]);
@@ -103,8 +108,8 @@ public class ThreadProcessUtils implements ApplicationContextAware, Initializing
         return result;
     }
 
-
-    public static <U> Map<String, CompletableFuture<U>> supplyAsync(Map<String, Supplier<U>> taskGroupMap) throws Exception {
+    public static <U> Map<String, CompletableFuture<U>> supplyAsync(Map<String, Supplier<U>> taskGroupMap)
+        throws Exception {
         return supplyAsync(true, taskGroupMap);
     }
 
@@ -117,21 +122,23 @@ public class ThreadProcessUtils implements ApplicationContextAware, Initializing
      * @return
      * @throws Exception
      */
-    public static <U> Map<String, CompletableFuture<U>> supplyAsync(boolean isBlockResult, Map<String, Supplier<U>> taskGroupMap) throws Exception {
+    public static <U> Map<String, CompletableFuture<U>> supplyAsync(boolean isBlockResult,
+        Map<String, Supplier<U>> taskGroupMap) throws Exception {
         return supplyAsync(isBlockResult, taskGroupMap, null);
     }
 
     /**
      * 异步调用
      *
-     * @param isBlockResult     是否阻塞直到结果获取完成
-     * @param taskGroupMap      任务组
-     * @param timeOutMs         等待获取时间
+     * @param isBlockResult 是否阻塞直到结果获取完成
+     * @param taskGroupMap  任务组
+     * @param timeOutMs     等待获取时间
      * @param <U>
      * @return
      * @throws Exception
      */
-    public static <U> Map<String, CompletableFuture<U>> supplyAsync(boolean isBlockResult, Map<String, Supplier<U>> taskGroupMap, Long timeOutMs) throws Exception {
+    public static <U> Map<String, CompletableFuture<U>> supplyAsync(boolean isBlockResult,
+        Map<String, Supplier<U>> taskGroupMap, Long timeOutMs) throws Exception {
         CompletableFuture<U>[] result = new CompletableFuture[taskGroupMap.size()];
 
         Map<String, CompletableFuture<U>> resultMap = new HashMap<>();
@@ -148,7 +155,8 @@ public class ThreadProcessUtils implements ApplicationContextAware, Initializing
         return resultMap;
     }
 
-    private static <U> void allOf(boolean isBlockResult, Long timeOutMs, CompletableFuture<U>[] result) throws InterruptedException, ExecutionException, TimeoutException {
+    private static <U> void allOf(boolean isBlockResult, Long timeOutMs, CompletableFuture<U>[] result)
+        throws InterruptedException, ExecutionException, TimeoutException {
         if (isBlockResult) {
             CompletableFuture<Void> completableFuture = CompletableFuture.allOf(result);
             if (timeOutMs != null) {
@@ -165,18 +173,21 @@ public class ThreadProcessUtils implements ApplicationContextAware, Initializing
         }
     }
 
-
     @Override
     public void afterPropertiesSet() throws Exception {
         taskProducer = this.applicationContext.getBean(ITaskProducer.class);
         this.threadProperties = this.applicationContext.getBean(ThreadProperties.class);
         if (this.threadProperties != null && this.threadProperties.getThreadPool() != null) {
             ThreadPoolProperties threadPool = this.threadProperties.getThreadPool();
-            ExecutorService executorService = new ThreadPoolExecutor(threadPool.getCorePoolSize(), threadPool.getMaximumPoolSize(), threadPool.getKeepAliveTime(), TimeUnit.SECONDS, new ArrayBlockingQueue(threadPool.getQueueSize()));
+            ExecutorService executorService =
+                new ThreadPoolExecutor(threadPool.getCorePoolSize(), threadPool.getMaximumPoolSize(),
+                    threadPool.getKeepAliveTime(), TimeUnit.SECONDS, new ArrayBlockingQueue(threadPool.getQueueSize()));
             setExecutorService(executorService);
         } else {
             ThreadPoolProperties threadPool = new ThreadPoolProperties();
-            ExecutorService executorService = new ThreadPoolExecutor(threadPool.getCorePoolSize(), threadPool.getMaximumPoolSize(), threadPool.getKeepAliveTime(), TimeUnit.SECONDS, new ArrayBlockingQueue(threadPool.getQueueSize()));
+            ExecutorService executorService =
+                new ThreadPoolExecutor(threadPool.getCorePoolSize(), threadPool.getMaximumPoolSize(),
+                    threadPool.getKeepAliveTime(), TimeUnit.SECONDS, new ArrayBlockingQueue(threadPool.getQueueSize()));
             setExecutorService(executorService);
         }
     }

+ 2 - 1
elab-spring/src/test/resources/logback.xml

@@ -10,7 +10,8 @@
         </encoder>
     </appender>
 
-    <appender name="cat" class="com.elab.log.log4j.CatLogbackLog"></appender>
+    <appender name="cat" class="com.elab.log.log4j.CatLogbackLog">
+    </appender>
 
     <logger name="com.elab" level="debug" additivity="false">
         <appender-ref ref="stdout"/>

+ 1 - 1
pom.xml

@@ -284,7 +284,7 @@
             <dependency>
                 <groupId>com.dianping.cat</groupId>
                 <artifactId>cat-core</artifactId>
-                <version>3.0.0</version>
+                <version>3.0.0-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.springframework</groupId>