Java Code Examples for org.messaginghub.pooled.jms.JmsPoolConnectionFactory#setUseAnonymousProducers()

The following examples show how to use org.messaginghub.pooled.jms.JmsPoolConnectionFactory#setUseAnonymousProducers() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MQConnectionFactoryConfiguration.java    From mq-jms-spring with Apache License 2.0 6 votes vote down vote up
private JmsPoolConnectionFactory create(ConnectionFactory connectionFactory, JmsPoolConnectionFactoryProperties poolProperties) {

      JmsPoolConnectionFactory pooledConnectionFactory = new JmsPoolConnectionFactory();
      pooledConnectionFactory.setConnectionFactory(connectionFactory);

      pooledConnectionFactory.setBlockIfSessionPoolIsFull(poolProperties.isBlockIfFull());

      if (poolProperties.getBlockIfFullTimeout() != null) {
        pooledConnectionFactory.setBlockIfSessionPoolIsFullTimeout(poolProperties.getBlockIfFullTimeout().toMillis());
      }

      if (poolProperties.getIdleTimeout() != null) {
        pooledConnectionFactory.setConnectionIdleTimeout((int) poolProperties.getIdleTimeout().toMillis());
      }

      pooledConnectionFactory.setMaxConnections(poolProperties.getMaxConnections());
      pooledConnectionFactory.setMaxSessionsPerConnection(poolProperties.getMaxSessionsPerConnection());

      if (poolProperties.getTimeBetweenExpirationCheck() != null) {
        pooledConnectionFactory.setConnectionCheckInterval(poolProperties.getTimeBetweenExpirationCheck().toMillis());
      }

      pooledConnectionFactory.setUseAnonymousProducers(poolProperties.isUseAnonymousProducers());
      return pooledConnectionFactory;
    }
 
Example 2
Source File: AMQP10JMSProperties.java    From amqp-10-jms-spring-boot with Apache License 2.0 6 votes vote down vote up
public void configurePooledFactory(JmsPoolConnectionFactory factory) {
    factory.setBlockIfSessionPoolIsFull(isBlockIfSessionPoolIsFull());
    if (getBlockIfSessionPoolIsFullTimeout() != null) {
        factory.setBlockIfSessionPoolIsFullTimeout(getBlockIfSessionPoolIsFullTimeout().toMillis());
    }
    if (getConnectionCheckInterval() != null) {
        factory.setConnectionCheckInterval(getConnectionCheckInterval().toMillis());
    }
    if (getConnectionIdleTimeout() != null) {
        factory.setConnectionIdleTimeout((int) getConnectionIdleTimeout().toMillis());
    }
    factory.setExplicitProducerCacheSize(getExplicitProducerCacheSize());
    factory.setMaxConnections(getMaxConnections());
    factory.setMaxSessionsPerConnection(getMaxSessionsPerConnection());
    factory.setUseAnonymousProducers(isUseAnonymousProducers());
    factory.setUseProviderJMSContext(isUseProviderJMSContext());
}