org.apache.activemq.artemis.jms.client.ActiveMQQueueConnectionFactory

Here are the examples of the java api class org.apache.activemq.artemis.jms.client.ActiveMQQueueConnectionFactory taken from open source projects.

1. JMSServerControlTest#testCreateConnectionFactory_CompleteList()

View license
@Test
public void testCreateConnectionFactory_CompleteList() throws Exception {
    JMSServerControl control = createManagementControl();
    //name
    control.createConnectionFactory(//name
    "test", // ha
    true, // useDiscovery
    false, // cfType
    1, // connectorNames
    "invm", // jndiBindins
    "tst", // clientID
    "tst", // clientFailureCheckPeriod
    1, // connectionTTL
    1, // callTimeout
    1, //callFailoverTimeout
    1, // minLargeMessageSize
    1, // compressLargeMessages
    true, // consumerWindowSize
    1, // consumerMaxRate
    1, // confirmationWindowSize
    1, // ProducerWindowSize
    1, // producerMaxRate
    1, // blockOnACK
    true, // blockOnDurableSend
    true, // blockOnNonDurableSend
    true, // autoGroup
    true, // preACK
    true, // loadBalancingClassName
    ActiveMQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME, // transactionBatchSize
    1, // dupsOKBatchSize
    1, // useGlobalPools
    true, // scheduleThreadPoolSize
    1, // threadPoolMaxSize
    1, // retryInterval
    1, // retryIntervalMultiplier
    1, // maxRetryInterval
    1, // reconnectAttempts
    1, // failoverOnInitialConnection
    true, // groupID
    "tst");
    ActiveMQQueueConnectionFactory cf = (ActiveMQQueueConnectionFactory) context.lookup("tst");
    Assert.assertEquals(true, cf.isHA());
    Assert.assertEquals("tst", cf.getClientID());
    Assert.assertEquals(1, cf.getClientFailureCheckPeriod());
    Assert.assertEquals(1, cf.getConnectionTTL());
    Assert.assertEquals(1, cf.getCallTimeout());
    Assert.assertEquals(1, cf.getCallFailoverTimeout());
    Assert.assertEquals(1, cf.getMinLargeMessageSize());
    Assert.assertEquals(true, cf.isCompressLargeMessage());
    Assert.assertEquals(1, cf.getConsumerWindowSize());
    Assert.assertEquals(1, cf.getConfirmationWindowSize());
    Assert.assertEquals(1, cf.getProducerWindowSize());
    Assert.assertEquals(1, cf.getProducerMaxRate());
    Assert.assertEquals(true, cf.isBlockOnAcknowledge());
    Assert.assertEquals(true, cf.isBlockOnDurableSend());
    Assert.assertEquals(true, cf.isBlockOnNonDurableSend());
    Assert.assertEquals(true, cf.isAutoGroup());
    Assert.assertEquals(true, cf.isPreAcknowledge());
    Assert.assertEquals(ActiveMQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME, cf.getConnectionLoadBalancingPolicyClassName());
    Assert.assertEquals(1, cf.getTransactionBatchSize());
    Assert.assertEquals(1, cf.getDupsOKBatchSize());
    Assert.assertEquals(true, cf.isUseGlobalPools());
    Assert.assertEquals(1, cf.getScheduledThreadPoolMaxSize());
    Assert.assertEquals(1, cf.getThreadPoolMaxSize());
    Assert.assertEquals(1, cf.getRetryInterval());
    Assert.assertEquals(1.0, cf.getRetryIntervalMultiplier(), 0.000001);
    Assert.assertEquals(1, cf.getMaxRetryInterval());
    Assert.assertEquals(1, cf.getReconnectAttempts());
    Assert.assertEquals(true, cf.isFailoverOnInitialConnection());
    Assert.assertEquals("tst", cf.getGroupID());
    server.stop();
    waitForServerToStop(server);
    startServer();
    control = createManagementControl();
    cf = (ActiveMQQueueConnectionFactory) context.lookup("tst");
    Assert.assertEquals(true, cf.isHA());
    Assert.assertEquals("tst", cf.getClientID());
    Assert.assertEquals(1, cf.getClientFailureCheckPeriod());
    Assert.assertEquals(1, cf.getConnectionTTL());
    Assert.assertEquals(1, cf.getCallTimeout());
    Assert.assertEquals(1, cf.getMinLargeMessageSize());
    Assert.assertEquals(true, cf.isCompressLargeMessage());
    Assert.assertEquals(1, cf.getConsumerWindowSize());
    Assert.assertEquals(1, cf.getConfirmationWindowSize());
    Assert.assertEquals(1, cf.getProducerWindowSize());
    Assert.assertEquals(1, cf.getProducerMaxRate());
    Assert.assertEquals(true, cf.isBlockOnAcknowledge());
    Assert.assertEquals(true, cf.isBlockOnDurableSend());
    Assert.assertEquals(true, cf.isBlockOnNonDurableSend());
    Assert.assertEquals(true, cf.isAutoGroup());
    Assert.assertEquals(true, cf.isPreAcknowledge());
    Assert.assertEquals(ActiveMQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME, cf.getConnectionLoadBalancingPolicyClassName());
    Assert.assertEquals(1, cf.getTransactionBatchSize());
    Assert.assertEquals(1, cf.getDupsOKBatchSize());
    Assert.assertEquals(true, cf.isUseGlobalPools());
    Assert.assertEquals(1, cf.getScheduledThreadPoolMaxSize());
    Assert.assertEquals(1, cf.getThreadPoolMaxSize());
    Assert.assertEquals(1, cf.getRetryInterval());
    Assert.assertEquals(1.0, cf.getRetryIntervalMultiplier(), 0.000001);
    Assert.assertEquals(1, cf.getMaxRetryInterval());
    Assert.assertEquals(1, cf.getReconnectAttempts());
    Assert.assertEquals(true, cf.isFailoverOnInitialConnection());
    Assert.assertEquals("tst", cf.getGroupID());
    control.destroyConnectionFactory("test");
    ObjectNameBuilder nameBuilder = ObjectNameBuilder.create(ActiveMQDefaultConfiguration.getDefaultJmxDomain());
    Assert.assertFalse(mbeanServer.isRegistered(nameBuilder.getConnectionFactoryObjectName("test")));
    server.stop();
    waitForServerToStop(server);
    startServer();
    Assert.assertFalse(mbeanServer.isRegistered(nameBuilder.getConnectionFactoryObjectName("test")));
    try {
        cf = (ActiveMQQueueConnectionFactory) context.lookup("tst");
        Assert.fail("Failure expected");
    } catch (NamingException e) {
    }
}

2. JMSServerControlUsingJMSTest#testCreateConnectionFactory_CompleteList()

View license
// The JMS test won't support the server being restarted, hence we have to do a slight different test on that case
@Override
@Test
public void testCreateConnectionFactory_CompleteList() throws Exception {
    JMSServerControl control = createManagementControl();
    //name
    control.createConnectionFactory(//name
    "test", // ha
    true, // useDiscovery
    false, // cfType
    1, // connectorNames
    "invm", // jndiBindins
    "tst", // clientID
    "tst", // clientFailureCheckPeriod
    1, // connectionTTL
    1, // callTimeout
    1, // callFailoverTimeout
    1, // minLargeMessageSize
    1, // compressLargeMessages
    true, // consumerWindowSize
    1, // consumerMaxRate
    1, // confirmationWindowSize
    1, // ProducerWindowSize
    1, // producerMaxRate
    1, // blockOnACK
    true, // blockOnDurableSend
    true, // blockOnNonDurableSend
    true, // autoGroup
    true, // preACK
    true, // loadBalancingClassName
    ActiveMQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME, // transactionBatchSize
    1, // dupsOKBatchSize
    1, // useGlobalPools
    true, // scheduleThreadPoolSize
    1, // threadPoolMaxSize
    1, // retryInterval
    1, // retryIntervalMultiplier
    1, // maxRetryInterval
    1, // reconnectAttempts
    1, // failoverOnInitialConnection
    true, // groupID
    "tst");
    ActiveMQQueueConnectionFactory cf = (ActiveMQQueueConnectionFactory) context.lookup("tst");
    Assert.assertEquals(true, cf.isHA());
    Assert.assertEquals("tst", cf.getClientID());
    Assert.assertEquals(1, cf.getClientFailureCheckPeriod());
    Assert.assertEquals(1, cf.getConnectionTTL());
    Assert.assertEquals(1, cf.getCallTimeout());
    Assert.assertEquals(1, cf.getCallFailoverTimeout());
    Assert.assertEquals(1, cf.getMinLargeMessageSize());
    Assert.assertEquals(true, cf.isCompressLargeMessage());
    Assert.assertEquals(1, cf.getConsumerWindowSize());
    Assert.assertEquals(1, cf.getConfirmationWindowSize());
    Assert.assertEquals(1, cf.getProducerWindowSize());
    Assert.assertEquals(1, cf.getProducerMaxRate());
    Assert.assertEquals(true, cf.isBlockOnAcknowledge());
    Assert.assertEquals(true, cf.isBlockOnDurableSend());
    Assert.assertEquals(true, cf.isBlockOnNonDurableSend());
    Assert.assertEquals(true, cf.isAutoGroup());
    Assert.assertEquals(true, cf.isPreAcknowledge());
    Assert.assertEquals(ActiveMQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME, cf.getConnectionLoadBalancingPolicyClassName());
    Assert.assertEquals(1, cf.getTransactionBatchSize());
    Assert.assertEquals(1, cf.getDupsOKBatchSize());
    Assert.assertEquals(true, cf.isUseGlobalPools());
    Assert.assertEquals(1, cf.getScheduledThreadPoolMaxSize());
    Assert.assertEquals(1, cf.getThreadPoolMaxSize());
    Assert.assertEquals(1, cf.getRetryInterval());
    Assert.assertEquals(1.0, cf.getRetryIntervalMultiplier(), 0.000001);
    Assert.assertEquals(1, cf.getMaxRetryInterval());
    Assert.assertEquals(1, cf.getReconnectAttempts());
    Assert.assertEquals(true, cf.isFailoverOnInitialConnection());
    Assert.assertEquals("tst", cf.getGroupID());
}