本文整理了Java中org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.setReconnectAttempts()
方法的一些代码示例,展示了ActiveMQConnectionFactory.setReconnectAttempts()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ActiveMQConnectionFactory.setReconnectAttempts()
方法的具体详情如下:
包路径:org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory
类名称:ActiveMQConnectionFactory
方法名:setReconnectAttempts
暂无
代码示例来源:origin: apache/activemq-artemis
@Test
public void testNoReconnectCloseAfterFailToReconnectWithTempQueue() throws Exception {
ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
jbcf.setReconnectAttempts(0);
Connection conn = jbcf.createConnection();
Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
sess.createTemporaryQueue();
Thread.sleep(2000);
this.server.stop();
this.server.start();
sess.close();
conn.close();
}
代码示例来源:origin: apache/activemq-artemis
@Test
public void testNoReconnectCloseAfterFailToReconnectWithTopicConsumer() throws Exception {
ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
jbcf.setReconnectAttempts(0);
Connection conn = jbcf.createConnection();
Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
ClientSession coreSession = ((ActiveMQSession) sess).getCoreSession();
coreSession.createQueue("mytopic", "blahblah", null, false);
Topic topic = ActiveMQJMSClient.createTopic("mytopic");
//Create a non durable subscriber
sess.createConsumer(topic);
Thread.sleep(2000);
this.server.stop();
this.server.start();
sess.close();
conn.close();
}
代码示例来源:origin: codice/ddf
private void createCamelContext() throws Exception {
CamelContext camelContext = getContext();
ActiveMQConnectionFactory factory =
ActiveMQJMSClient.createConnectionFactory(
"(tcp://0.0.0.0:5672,tcp://0.0.0.0:61617)?ha=true;sslEnabled=true;enabledCipherSuites=TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256;enabledProtocols=TLSv1.1,TLSv1.2",
"name");
factory.setRetryInterval(1000);
factory.setRetryIntervalMultiplier(1.0);
factory.setReconnectAttempts(-1);
Sjms2Component sjms2 = new Sjms2Component();
ConnectionFactoryResource connectionResource =
new ConnectionFactoryResource(1, factory, "admin", "admin");
sjms2.setConnectionResource(connectionResource);
camelContext.addComponent("sjms2", sjms2);
}
代码示例来源:origin: apache/activemq-artemis
@Test
public void testCloseConnectionAfterServerIsShutdown() throws Exception {
server.start();
jbcf = createConnectionFactory();
jbcf.setBlockOnDurableSend(true);
jbcf.setBlockOnNonDurableSend(true);
jbcf.setReconnectAttempts(-1);
conn = jbcf.createConnection();
server.stop();
conn.close();
}
代码示例来源:origin: apache/activemq-artemis
cf.setReconnectAttempts(0);
cf.setInitialConnectAttempts(0);
cf.setEnable1xPrefixes(raProperties.isEnable1xPrefixes() == null ? false : raProperties.isEnable1xPrefixes());
代码示例来源:origin: apache/activemq-artemis
jbcf.setReconnectAttempts(-1);
jbcf.setBlockOnDurableSend(true);
jbcf.setBlockOnNonDurableSend(true);
代码示例来源:origin: org.apache.activemq/artemis-ra
cf.setReconnectAttempts(0);
cf.setInitialConnectAttempts(0);
cf.setEnable1xPrefixes(raProperties.isEnable1xPrefixes() == null ? false : raProperties.isEnable1xPrefixes());
代码示例来源:origin: apache/activemq-artemis
@Test
public void testCreateQueue() throws Exception {
liveJMSServer.createQueue(true, "queue1", null, true, "/queue/queue1");
assertNotNull(ctx1.lookup("/queue/queue1"));
ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, livetc);
jbcf.setReconnectAttempts(-1);
Connection conn = null;
try {
conn = JMSUtil.createConnectionAndWaitForTopology(jbcf, 2, 5);
Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
ClientSession coreSession = ((ActiveMQSession) sess).getCoreSession();
JMSUtil.crash(liveServer, coreSession);
assertNotNull(ctx2.lookup("/queue/queue1"));
} finally {
if (conn != null) {
conn.close();
}
}
}
代码示例来源:origin: apache/activemq-artemis
@Test
public void testCreateTopic() throws Exception {
liveJMSServer.createTopic(true, "topic", "/topic/t1");
assertNotNull(ctx1.lookup("//topic/t1"));
ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, livetc);
jbcf.setReconnectAttempts(-1);
Connection conn = null;
try {
conn = JMSUtil.createConnectionAndWaitForTopology(jbcf, 2, 5);
Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
ClientSession coreSession = ((ActiveMQSession) sess).getCoreSession();
JMSUtil.crash(liveServer, coreSession);
assertNotNull(ctx2.lookup("/topic/t1"));
} finally {
if (conn != null) {
conn.close();
}
}
}
代码示例来源:origin: apache/activemq-artemis
jbcfBackup.setBlockOnDurableSend(true);
jbcfBackup.setInitialConnectAttempts(-1);
jbcfBackup.setReconnectAttempts(-1);
代码示例来源:origin: apache/activemq-artemis
private void testReconnectSameNodeServerRestartedWithNonDurableSubOrTempQueue(final boolean nonDurableSub) throws Exception {
ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
jbcf.setReconnectAttempts(-1);
代码示例来源:origin: apache/activemq-artemis
@Test
public void testAutomaticFailover() throws Exception {
ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, livetc);
jbcf.setReconnectAttempts(-1);
jbcf.setBlockOnDurableSend(true);
jbcf.setBlockOnNonDurableSend(true);
代码示例来源:origin: apache/activemq-artemis
jbcfBackup.setBlockOnDurableSend(true);
jbcfBackup.setInitialConnectAttempts(-1);
jbcfBackup.setReconnectAttempts(-1);
代码示例来源:origin: apache/activemq-artemis
jbcf.setBlockOnNonDurableSend(true);
jbcf.setReconnectAttempts(-1);
代码示例来源:origin: apache/activemq-artemis
@Test
public void testAutomaticFailover() throws Exception {
ActiveMQConnectionFactory jbcf = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, livetc);
jbcf.setReconnectAttempts(-1);
jbcf.setBlockOnDurableSend(true);
jbcf.setBlockOnNonDurableSend(true);
代码示例来源:origin: apache/activemq-artemis
cf.setRetryIntervalMultiplier(cfConfig.getRetryIntervalMultiplier());
cf.setMaxRetryInterval(cfConfig.getMaxRetryInterval());
cf.setReconnectAttempts(cfConfig.getReconnectAttempts());
cf.setFailoverOnInitialConnection(cfConfig.isFailoverOnInitialConnection());
cf.setCompressLargeMessage(cfConfig.isCompressLargeMessages());
代码示例来源:origin: org.apache.activemq/artemis-ra
cf.setReconnectAttempts(val2);
} else {
cf.setReconnectAttempts(-1);
代码示例来源:origin: apache/activemq-artemis
factory.setRetryInterval(retryInterval);
factory.setRetryIntervalMultiplier(retryIntervalMultiplier);
factory.setReconnectAttempts(reconnectAttempts);
代码示例来源:origin: apache/activemq-artemis
cf.setRetryInterval(retryInterval);
cf.setRetryIntervalMultiplier(retryIntervalMultiplier);
cf.setReconnectAttempts(reconnectAttempts);
Assert.assertEquals(clientFailureCheckPeriod, cf.getClientFailureCheckPeriod());
Assert.assertEquals(connectionTTL, cf.getConnectionTTL());
代码示例来源:origin: apache/activemq-artemis
cf.setReconnectAttempts(reconnectAttempts);
Assert.fail("Should throw exception");
} catch (IllegalStateException e) {
内容来源于网络,如有侵权,请联系作者删除!