public synchronized void setCallTimeout(final long callTimeout) { checkWrite(); serverLocator.setCallTimeout(callTimeout); }
public synchronized void setCallTimeout(final long callTimeout) { checkWrite(); serverLocator.setCallTimeout(callTimeout); }
public synchronized void setCallTimeout(final long callTimeout) { checkWrite(); serverLocator.setCallTimeout(callTimeout); }
public synchronized void setCallTimeout(final long callTimeout) { checkWrite(); serverLocator.setCallTimeout(callTimeout); }
public synchronized void setCallTimeout(final long callTimeout) { checkWrite(); serverLocator.setCallTimeout(callTimeout); }
@Override @Before public void setUp() throws Exception { super.setUp(); locator = createFactory(isNetty()); locator.setCallTimeout(100000000); }
@Test public void testCloseSessionFactory() throws Exception { ServerLocator locator = createInVMNonHALocator().setReconnectAttempts(-1).setConnectionTTL(1000).setClientFailureCheckPeriod(100).setConsumerWindowSize(10 * 1024 * 1024).setCallTimeout(1000); ClientSessionFactory sf = locator.createSessionFactory(); final CountDownLatch latch = new CountDownLatch(1); sf.addFailoverListener(eventType -> { if (eventType == FailoverEventType.FAILURE_DETECTED) { try { /** * We close client session factory during this period and * expect reconnection stopped without exception which notifies * FAILOVER_FAILED event. See ARTEMIS-1949. */ Thread.sleep(1000L); } catch (InterruptedException e) { e.printStackTrace(); } } else if (eventType == FailoverEventType.FAILOVER_FAILED) { latch.countDown(); } }); server.stop(); Thread.sleep(600); sf.close(); assertTrue(latch.await(1000, TimeUnit.MILLISECONDS)); } }
@Test public void testPlainConnectionToSSLEndpoint() throws Exception { createCustomSslServer(); tc.getParams().put(TransportConstants.SSL_ENABLED_PROP_NAME, false); ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc)).setCallTimeout(2000); try { createSessionFactory(locator); fail("expecting exception"); } catch (ActiveMQNotConnectedException se) { //ok } catch (ActiveMQConnectionTimedOutException ctoe) { //ok } catch (ActiveMQException e) { fail("Invalid Exception type:" + e.getType()); } }
ServerLocator locatorTimeout = createInVMNonHALocator().setCallTimeout(300); ClientSessionFactory factoryTimeout = locatorTimeout.createSessionFactory();
@Test(timeout = 120000) public void testTimeoutOnFailoverConsume() throws Exception { locator.setCallTimeout(5000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setBlockOnAcknowledge(true).setReconnectAttempts(300).setRetryInterval(100).setAckBatchSize(0);
@Test public void testNettyConnectionLimit() throws Exception { ServerLocator locator = createNonHALocator(true).setCallTimeout(3000); ClientSessionFactory clientSessionFactory = locator.createSessionFactory(); ClientSession clientSession = addClientSession(clientSessionFactory.createSession()); try { ClientSessionFactory extraClientSessionFactory = locator.createSessionFactory(); ClientSession extraClientSession = addClientSession(extraClientSessionFactory.createSession()); fail("creating a session here should fail"); } catch (Exception e) { assertTrue(e instanceof ActiveMQConnectionTimedOutException); } } }
@Test(timeout = 120000) public void testTimeoutOnFailoverTransactionCommit() throws Exception { locator.setCallTimeout(5000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(300).setRetryInterval(100);
@Test(timeout = 120000) public void testTimeoutOnFailoverTransactionRollback() throws Exception { locator.setCallTimeout(2000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(300).setRetryInterval(100);
existingLocator.setCallTimeout(3000); ClientSessionFactory existingSessionFactory = addSessionFactory(createSessionFactory(existingLocator)); ClientSession existingSession = addClientSession(existingSessionFactory.createSession(false, true, true)); tc.getParams().put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, PASSWORD); ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc)).setCallTimeout(3000); try { addSessionFactory(createSessionFactory(locator));
locator.setCallTimeout(1000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(300).setRetryInterval(500);
locator = createInVMNonHALocator().setClientFailureCheckPeriod(120000).setConnectionTTL(5000000).setCallTimeout(120000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true);
ServerLocator locator = createInVMNonHALocator().setClientFailureCheckPeriod(120000).setConnectionTTL(5000000).setCallTimeout(120000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true);
ServerLocator locator = createInVMNonHALocator().setClientFailureCheckPeriod(120000).setConnectionTTL(5000000).setCallTimeout(120000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true);
ServerLocator locator = createInVMNonHALocator().setClientFailureCheckPeriod(120000).setConnectionTTL(5000000).setCallTimeout(120000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true);
TransportConfiguration[] tc = new TransportConfiguration[]{liveTC}; ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(tc).setClientFailureCheckPeriod(clientFailureCheckPeriod).setConnectionTTL(connectionTTL).setCallTimeout(callTimeout).setMinLargeMessageSize(minLargeMessageSize).setConsumerWindowSize(consumerWindowSize).setConsumerMaxRate(consumerMaxRate).setConfirmationWindowSize(confirmationWindowSize).setProducerMaxRate(producerMaxRate).setBlockOnAcknowledge(blockOnAcknowledge).setBlockOnDurableSend(blockOnDurableSend).setBlockOnNonDurableSend(blockOnNonDurableSend).setAutoGroup(autoGroup).setPreAcknowledge(preAcknowledge).setConnectionLoadBalancingPolicyClassName(loadBalancingPolicyClassName).setAckBatchSize(ackBatchSize).setUseGlobalPools(useGlobalPools).setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize).setThreadPoolMaxSize(threadPoolMaxSize).setRetryInterval(retryInterval).setRetryIntervalMultiplier(retryIntervalMultiplier).setReconnectAttempts(reconnectAttempts);