| | |
| | | |
| | | private final GenericObjectPool<MqttClient> pool; |
| | | |
| | | public MqttClientPool(String broker, String username, String password, int maxConnections) { |
| | | MqttClientPooledObjectFactory factory = new MqttClientPooledObjectFactory(broker, username, password); |
| | | public MqttClientPool(String broker, String username, String password, int maxConnections, boolean useMemoryPersistence) { |
| | | MqttClientPooledObjectFactory factory = new MqttClientPooledObjectFactory(broker, username, password, useMemoryPersistence); |
| | | GenericObjectPoolConfig<MqttClient> config = new GenericObjectPoolConfig<>(); |
| | | config.setMaxTotal(maxConnections); |
| | | config.setMaxIdle(maxConnections); |