Bladeren bron

计数线程处理调整

master
林万龙 3 jaren geleden
bovenliggende
commit
60c835db12
2 gewijzigde bestanden met toevoegingen van 6 en 6 verwijderingen
  1. +4
    -4
      src/main/java/com/telpo/iotgateway/listener/IotMessageListener.java
  2. +2
    -2
      src/main/java/com/telpo/iotgateway/server/IotSubscribe.java

+ 4
- 4
src/main/java/com/telpo/iotgateway/listener/IotMessageListener.java Bestand weergeven

@@ -77,10 +77,10 @@ public class IotMessageListener implements MessageListener {
String content = new String(body); String content = new String(body);
String topic = message.getStringProperty("topic"); String topic = message.getStringProperty("topic");
String messageId = message.getStringProperty("messageId"); String messageId = message.getStringProperty("messageId");
// log.info("receive message"
// + ", topic = " + topic
// + ", messageId = " + messageId
// + ", content = " + content);
log.info("receive message"
+ ", topic = " + topic
+ ", messageId = " + messageId
+ ", content = " + content);
count.getAndIncrement(); count.getAndIncrement();


} catch (Exception e) { } catch (Exception e) {


+ 2
- 2
src/main/java/com/telpo/iotgateway/server/IotSubscribe.java Bestand weergeven

@@ -51,8 +51,8 @@ public class IotSubscribe {


// 执行单元线程池 // 执行单元线程池
private final static ExecutorService executorService = new ThreadPoolExecutor( private final static ExecutorService executorService = new ThreadPoolExecutor(
Runtime.getRuntime().availableProcessors(),
Runtime.getRuntime().availableProcessors() * 2, 60, TimeUnit.SECONDS,
Runtime.getRuntime().availableProcessors() - 1,
(Runtime.getRuntime().availableProcessors() -1)* 2, 60, TimeUnit.SECONDS,
new LinkedBlockingQueue<>(50000)); new LinkedBlockingQueue<>(50000));
// Jms连接侦听 // Jms连接侦听
private static JmsConnectionListener myJmsConnectionListener = new IotJmsConnectionListener(); private static JmsConnectionListener myJmsConnectionListener = new IotJmsConnectionListener();


Laden…
Annuleren
Opslaan