Merge branch '2.0.x'

pull/13961/merge
Stephane Nicoll 6 years ago
commit fbf95b6997

@ -52,12 +52,6 @@ public class PooledConnectionFactoryFactory {
pooledConnectionFactory.setBlockIfSessionPoolIsFullTimeout(
this.properties.getBlockIfFullTimeout().toMillis());
}
pooledConnectionFactory.setCreateConnectionOnStartup(
this.properties.isCreateConnectionOnStartup());
if (this.properties.getExpiryTimeout() != null) {
pooledConnectionFactory
.setExpiryTimeout(this.properties.getExpiryTimeout().toMillis());
}
if (this.properties.getIdleTimeout() != null) {
pooledConnectionFactory
.setIdleTimeout((int) this.properties.getIdleTimeout().toMillis());
@ -65,8 +59,6 @@ public class PooledConnectionFactoryFactory {
pooledConnectionFactory.setMaxConnections(this.properties.getMaxConnections());
pooledConnectionFactory.setMaximumActiveSessionPerConnection(
this.properties.getMaximumActiveSessionPerConnection());
pooledConnectionFactory
.setReconnectOnException(this.properties.isReconnectOnException());
if (this.properties.getTimeBetweenExpirationCheck() != null) {
pooledConnectionFactory.setTimeBetweenExpirationCheckMillis(
this.properties.getTimeBetweenExpirationCheck().toMillis());

@ -43,17 +43,6 @@ public class PooledConnectionFactoryProperties {
*/
private Duration blockIfFullTimeout = Duration.ofMillis(-1);
/**
* Whether to create a connection on startup. Can be used to warm up the pool on
* startup.
*/
private boolean createConnectionOnStartup = true;
/**
* Connection expiration timeout.
*/
private Duration expiryTimeout = Duration.ofMillis(0);
/**
* Connection idle timeout.
*/
@ -69,11 +58,6 @@ public class PooledConnectionFactoryProperties {
*/
private int maximumActiveSessionPerConnection = 500;
/**
* Reset the connection when a "JMSException" occurs.
*/
private boolean reconnectOnException = true;
/**
* Time to sleep between runs of the idle connection eviction thread. When negative,
* no idle connection eviction thread runs.
@ -110,22 +94,6 @@ public class PooledConnectionFactoryProperties {
this.blockIfFullTimeout = blockIfFullTimeout;
}
public boolean isCreateConnectionOnStartup() {
return this.createConnectionOnStartup;
}
public void setCreateConnectionOnStartup(boolean createConnectionOnStartup) {
this.createConnectionOnStartup = createConnectionOnStartup;
}
public Duration getExpiryTimeout() {
return this.expiryTimeout;
}
public void setExpiryTimeout(Duration expiryTimeout) {
this.expiryTimeout = expiryTimeout;
}
public Duration getIdleTimeout() {
return this.idleTimeout;
}
@ -151,14 +119,6 @@ public class PooledConnectionFactoryProperties {
this.maximumActiveSessionPerConnection = maximumActiveSessionPerConnection;
}
public boolean isReconnectOnException() {
return this.reconnectOnException;
}
public void setReconnectOnException(boolean reconnectOnException) {
this.reconnectOnException = reconnectOnException;
}
public Duration getTimeBetweenExpirationCheck() {
return this.timeBetweenExpirationCheck;
}

@ -179,10 +179,6 @@ public class ActiveMQAutoConfigurationTests {
assertThat(connectionFactory.getBlockIfSessionPoolIsFullTimeout())
.isEqualTo(
defaultFactory.getBlockIfSessionPoolIsFullTimeout());
assertThat(connectionFactory.isCreateConnectionOnStartup())
.isEqualTo(defaultFactory.isCreateConnectionOnStartup());
assertThat(connectionFactory.getExpiryTimeout())
.isEqualTo(defaultFactory.getExpiryTimeout());
assertThat(connectionFactory.getIdleTimeout())
.isEqualTo(defaultFactory.getIdleTimeout());
assertThat(connectionFactory.getMaxConnections())
@ -190,8 +186,6 @@ public class ActiveMQAutoConfigurationTests {
assertThat(connectionFactory.getMaximumActiveSessionPerConnection())
.isEqualTo(defaultFactory
.getMaximumActiveSessionPerConnection());
assertThat(connectionFactory.isReconnectOnException())
.isEqualTo(defaultFactory.isReconnectOnException());
assertThat(connectionFactory.getTimeBetweenExpirationCheckMillis())
.isEqualTo(
defaultFactory.getTimeBetweenExpirationCheckMillis());
@ -206,12 +200,9 @@ public class ActiveMQAutoConfigurationTests {
.withPropertyValues("spring.activemq.pool.enabled=true",
"spring.activemq.pool.blockIfFull=false",
"spring.activemq.pool.blockIfFullTimeout=64",
"spring.activemq.pool.createConnectionOnStartup=false",
"spring.activemq.pool.expiryTimeout=4096",
"spring.activemq.pool.idleTimeout=512",
"spring.activemq.pool.maxConnections=256",
"spring.activemq.pool.maximumActiveSessionPerConnection=1024",
"spring.activemq.pool.reconnectOnException=false",
"spring.activemq.pool.timeBetweenExpirationCheck=2048",
"spring.activemq.pool.useAnonymousProducers=false")
.run((context) -> {
@ -222,13 +213,10 @@ public class ActiveMQAutoConfigurationTests {
assertThat(connectionFactory.isBlockIfSessionPoolIsFull()).isFalse();
assertThat(connectionFactory.getBlockIfSessionPoolIsFullTimeout())
.isEqualTo(64);
assertThat(connectionFactory.isCreateConnectionOnStartup()).isFalse();
assertThat(connectionFactory.getExpiryTimeout()).isEqualTo(4096);
assertThat(connectionFactory.getIdleTimeout()).isEqualTo(512);
assertThat(connectionFactory.getMaxConnections()).isEqualTo(256);
assertThat(connectionFactory.getMaximumActiveSessionPerConnection())
.isEqualTo(1024);
assertThat(connectionFactory.isReconnectOnException()).isFalse();
assertThat(connectionFactory.getTimeBetweenExpirationCheckMillis())
.isEqualTo(2048);
assertThat(connectionFactory.isUseAnonymousProducers()).isFalse();

@ -962,13 +962,10 @@ content into your application. Rather, pick only the properties that you need.
spring.activemq.packages.trusted= # Comma-separated list of specific packages to trust (when not trusting all packages).
spring.activemq.pool.block-if-full=true # Whether to block when a connection is requested and the pool is full. Set it to false to throw a "JMSException" instead.
spring.activemq.pool.block-if-full-timeout=-1ms # Blocking period before throwing an exception if the pool is still full.
spring.activemq.pool.create-connection-on-startup=true # Whether to create a connection on startup. Can be used to warm up the pool on startup.
spring.activemq.pool.enabled=false # Whether a PooledConnectionFactory should be created, instead of a regular ConnectionFactory.
spring.activemq.pool.expiry-timeout=0ms # Connection expiration timeout.
spring.activemq.pool.idle-timeout=30s # Connection idle timeout.
spring.activemq.pool.max-connections=1 # Maximum number of pooled connections.
spring.activemq.pool.maximum-active-session-per-connection=500 # Maximum number of active sessions per connection.
spring.activemq.pool.reconnect-on-exception=true # Reset the connection when a "JMSException" occurs.
spring.activemq.pool.time-between-expiration-check=-1ms # Time to sleep between runs of the idle connection eviction thread. When negative, no idle connection eviction thread runs.
spring.activemq.pool.use-anonymous-producers=true # Whether to use only one anonymous "MessageProducer" instance. Set it to false to create one "MessageProducer" every time one is required.

@ -5119,6 +5119,8 @@ accordingly, as shown in the following example:
spring.activemq.pool.max-connections=50
----
WARNING: `PooledConnectionFactory` is not JMS 2.0 compliant
TIP: See
{sc-spring-boot-autoconfigure}/jms/activemq/ActiveMQProperties.{sc-ext}[`ActiveMQProperties`]
for more of the supported options. You can also register an arbitrary number of beans

Loading…
Cancel
Save