• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TransportConstants类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants的典型用法代码示例。如果您正苦于以下问题:Java TransportConstants类的具体用法?Java TransportConstants怎么用?Java TransportConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TransportConstants类属于org.apache.activemq.artemis.core.remoting.impl.netty包,在下文中一共展示了TransportConstants类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createConnectionFactory

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
/**
 * 
 * @param config
 * @return
 * @throws Exception
 */
private static ActiveMQConnectionFactory createConnectionFactory(BrokerConfig config) throws Exception {
	Map<String, Object> params = Collections.singletonMap(
			org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "1");
	final ActiveMQConnectionFactory connectionFactory;
	if (config.getUrl() != null) {
		connectionFactory = ActiveMQJMSClient.createConnectionFactory(config.getUrl(), null);
	} else {
		if (config.getHost() != null) {
			params.put(TransportConstants.HOST_PROP_NAME, config.getHost());
			params.put(TransportConstants.PORT_PROP_NAME, config.getPort());
		}
		if (config.isHa()) {
			connectionFactory = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, new TransportConfiguration(config.getConnectorFactory(), params));
		} else {
			connectionFactory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(config.getConnectorFactory(), params));
		}
	}
	if (config.isSecurityEnabled()) {
		connectionFactory.setUser(config.getUsername());
		connectionFactory.setPassword(config.getPassword());
	}
	return connectionFactory.disableFinalizeChecks();
}
 
开发者ID:dansiviter,项目名称:cito,代码行数:30,代码来源:BrokerProvider.java


示例2: createNativeConnectionFactory

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
private <T extends ActiveMQConnectionFactory> T createNativeConnectionFactory(
		Class<T> factoryClass) throws Exception {
	Map<String, Object> params = new HashMap<String, Object>();
	params.put(TransportConstants.HOST_PROP_NAME, this.properties.getHost());
	params.put(TransportConstants.PORT_PROP_NAME, this.properties.getPort());
	TransportConfiguration transportConfiguration = new TransportConfiguration(
			NettyConnectorFactory.class.getName(), params);
	Constructor<T> constructor = factoryClass.getConstructor(boolean.class,
			TransportConfiguration[].class);
	T connectionFactory = constructor.newInstance(false,
			new TransportConfiguration[] { transportConfiguration });
	String user = this.properties.getUser();
	if (StringUtils.hasText(user)) {
		connectionFactory.setUser(user);
		connectionFactory.setPassword(this.properties.getPassword());
	}
	return connectionFactory;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:19,代码来源:ArtemisConnectionFactoryFactory.java


示例3: createConnectionFactory

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
private ActiveMQConnectionFactory createConnectionFactory() throws Exception {
   Map<String, Object> params = new HashMap<>();
   params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "1");
   final ActiveMQConnectionFactory activeMQConnectionFactory;
   if (configuration.getUrl() != null) {
      activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactory(configuration.getUrl(), null);
   } else {
      if (configuration.getHost() != null) {
         params.put(TransportConstants.HOST_PROP_NAME, configuration.getHost());
         params.put(TransportConstants.PORT_PROP_NAME, configuration.getPort());
      }
      if (configuration.isHa()) {
         activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, new TransportConfiguration(configuration.getConnectorFactory(), params));
      } else {
         activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(configuration.getConnectorFactory(), params));
      }
   }
   if (configuration.hasAuthentication()) {
      activeMQConnectionFactory.setUser(configuration.getUsername());
      activeMQConnectionFactory.setPassword(configuration.getPassword());
   }
   // The CF will probably be GCed since it was injected, so we disable the finalize check
   return activeMQConnectionFactory.disableFinalizeChecks();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:25,代码来源:ConnectionFactoryProvider.java


示例4: createServer

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
/**
 * @return
 * @throws Exception
 */
private JMSServerManager createServer() throws Exception {
   Map<String, Object> params = new HashMap<>();
   params.put(TransportConstants.PROTOCOLS_PROP_NAME, StompProtocolManagerFactory.STOMP_PROTOCOL_NAME);
   params.put(TransportConstants.PORT_PROP_NAME, TransportConstants.DEFAULT_STOMP_PORT + 1);
   TransportConfiguration stompTransport = new TransportConfiguration(NettyAcceptorFactory.class.getName(), params);

   Configuration config = createBasicConfig().addAcceptorConfiguration(stompTransport).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName())).addQueueConfiguration(new CoreQueueConfiguration().setAddress(getQueueName()).setName(getQueueName()).setDurable(false));

   ActiveMQServer activeMQServer = addServer(ActiveMQServers.newActiveMQServer(config));

   JMSConfiguration jmsConfig = new JMSConfigurationImpl();
   server = new JMSServerManagerImpl(activeMQServer, jmsConfig);
   server.setRegistry(null);
   return server;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:20,代码来源:StompWebSocketTest.java


示例5: testTransportConfiguration

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Test
public void testTransportConfiguration() throws Exception {
   Map<String, Object> params = new HashMap<>();
   params.put(TransportConstants.PORT_PROP_NAME, 5665);
   params.put(TransportConstants.HOST_PROP_NAME, RandomUtil.randomString());
   TransportConfiguration config = new TransportConfiguration(NettyConnectorFactory.class.getName(), params);

   ActiveMQBuffer buffer = ActiveMQBuffers.fixedBuffer(TransportConfigurationEncodingSupport.getEncodeSize(config));
   TransportConfigurationEncodingSupport.encode(buffer, config);

   assertEquals(buffer.capacity(), buffer.writerIndex());
   buffer.readerIndex(0);

   TransportConfiguration decoded = TransportConfigurationEncodingSupport.decode(buffer);
   assertNotNull(decoded);

   assertEquals(config.getName(), decoded.getName());
   assertEquals(config.getFactoryClassName(), decoded.getFactoryClassName());
   assertEquals(config.getParams().size(), decoded.getParams().size());
   for (String key : config.getParams().keySet()) {
      assertEquals(config.getParams().get(key).toString(), decoded.getParams().get(key).toString());
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:24,代码来源:TransportConfigurationEncodingSupportTest.java


示例6: setUp

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
   super.setUp();

   Map<String, Object> params = new HashMap<>();
   params.put(TransportConstants.DIRECT_DELIVER, true);

   TransportConfiguration tc = new TransportConfiguration(NettyAcceptorFactory.class.getName(), params);

   Configuration config = createBasicConfig().addAcceptorConfiguration(tc);
   server = createServer(false, config);
   server.start();

   locator = createNettyNonHALocator();
   addServerLocator(locator);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:18,代码来源:DirectDeliverTest.java


示例7: internalNewObject

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Override
protected ActiveMQConnectionFactory internalNewObject(URI uri,
                                                      Map<String, String> query,
                                                      String name) throws Exception {
   JMSConnectionOptions options = newConectionOptions(uri, query);

   List<TransportConfiguration> configurations = TCPTransportConfigurationSchema.getTransportConfigurations(uri, query, TransportConstants.ALLOWABLE_CONNECTOR_KEYS, name, NettyConnectorFactory.class.getName());

   TransportConfiguration[] tcs = new TransportConfiguration[configurations.size()];

   configurations.toArray(tcs);

   ActiveMQConnectionFactory factory;

   if (options.isHa()) {
      factory = ActiveMQJMSClient.createConnectionFactoryWithHA(options.getFactoryTypeEnum(), tcs);
   } else {
      factory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(options.getFactoryTypeEnum(), tcs);
   }

   return BeanSupport.setData(uri, factory, query);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:23,代码来源:TCPSchema.java


示例8: testTwoWaySSLVerifyClientTrustAllTrue

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Test
public void testTwoWaySSLVerifyClientTrustAllTrue() throws Exception {
   NettyAcceptor acceptor = (NettyAcceptor) server.getRemotingService().getAcceptor("nettySSL");
   acceptor.getConfiguration().put(TransportConstants.NEED_CLIENT_AUTH_PROP_NAME, true);
   server.getRemotingService().stop(false);
   server.getRemotingService().start();
   server.getRemotingService().startAcceptors();

   //Set trust all so this should work even with no trust store set
   tc.getParams().put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
   tc.getParams().put(TransportConstants.TRUST_ALL_PROP_NAME, true);
   tc.getParams().put(TransportConstants.KEYSTORE_PROVIDER_PROP_NAME, storeType);
   tc.getParams().put(TransportConstants.KEYSTORE_PATH_PROP_NAME, CLIENT_SIDE_KEYSTORE);
   tc.getParams().put(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME, PASSWORD);

   server.getRemotingService().addIncomingInterceptor(new MyInterceptor());

   ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc));
   ClientSessionFactory sf = createSessionFactory(locator);
   sf.close();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:22,代码来源:CoreClientOverTwoWaySSLTest.java


示例9: testTwoWaySSLVerifyClientTrustAllTrueByURI

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Test
public void testTwoWaySSLVerifyClientTrustAllTrueByURI() throws Exception {
   NettyAcceptor acceptor = (NettyAcceptor) server.getRemotingService().getAcceptor("nettySSL");
   acceptor.getConfiguration().put(TransportConstants.NEED_CLIENT_AUTH_PROP_NAME, true);
   server.getRemotingService().stop(false);
   server.getRemotingService().start();
   server.getRemotingService().startAcceptors();

   //Set trust all so this should work even with no trust store set
   StringBuilder uri = new StringBuilder("tcp://" + tc.getParams().get(TransportConstants.HOST_PROP_NAME).toString()
         + ":" + tc.getParams().get(TransportConstants.PORT_PROP_NAME).toString());

   uri.append("?").append(TransportConstants.SSL_ENABLED_PROP_NAME).append("=true");
   uri.append("&").append(TransportConstants.TRUST_ALL_PROP_NAME).append("=true");
   uri.append("&").append(TransportConstants.KEYSTORE_PROVIDER_PROP_NAME).append("=").append(storeType);
   uri.append("&").append(TransportConstants.KEYSTORE_PATH_PROP_NAME).append("=").append(CLIENT_SIDE_KEYSTORE);
   uri.append("&").append(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME).append("=").append(PASSWORD);

   server.getRemotingService().addIncomingInterceptor(new MyInterceptor());

   ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocator(uri.toString()));
   ClientSessionFactory sf = createSessionFactory(locator);
   sf.close();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:25,代码来源:CoreClientOverTwoWaySSLTest.java


示例10: testTwoWaySSLVerifyClientTrustAllFalse

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Test
public void testTwoWaySSLVerifyClientTrustAllFalse() throws Exception {
   NettyAcceptor acceptor = (NettyAcceptor) server.getRemotingService().getAcceptor("nettySSL");
   acceptor.getConfiguration().put(TransportConstants.NEED_CLIENT_AUTH_PROP_NAME, true);
   server.getRemotingService().stop(false);
   server.getRemotingService().start();
   server.getRemotingService().startAcceptors();

   //Trust all defaults to false so this should fail with no trust store set
   tc.getParams().put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
   tc.getParams().put(TransportConstants.KEYSTORE_PROVIDER_PROP_NAME, storeType);
   tc.getParams().put(TransportConstants.KEYSTORE_PATH_PROP_NAME, CLIENT_SIDE_KEYSTORE);
   tc.getParams().put(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME, PASSWORD);

   server.getRemotingService().addIncomingInterceptor(new MyInterceptor());

   ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc));
   try {
      ClientSessionFactory sf = createSessionFactory(locator);
      fail("Creating a session here should fail due to no trust store being set");
   } catch (Exception e) {
      // ignore
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:25,代码来源:CoreClientOverTwoWaySSLTest.java


示例11: testTwoWaySSLWithoutClientKeyStore

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Test
public void testTwoWaySSLWithoutClientKeyStore() throws Exception {
   tc.getParams().put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PROVIDER_PROP_NAME, storeType);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PATH_PROP_NAME, CLIENT_SIDE_TRUSTSTORE);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, PASSWORD);

   ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc));
   try {
      createSessionFactory(locator);
      Assert.fail();
   } catch (ActiveMQNotConnectedException se) {
      //ok
   } catch (ActiveMQException e) {
      Assert.fail("Invalid Exception type:" + e.getType());
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:18,代码来源:CoreClientOverTwoWaySSLTest.java


示例12: getConnectionCapabilitiesOffered

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
public Symbol[] getConnectionCapabilitiesOffered() {
   URI tc = connectionCallback.getFailoverList();
   if (tc != null) {
      Map<Symbol, Object> hostDetails = new HashMap<>();
      hostDetails.put(NETWORK_HOST, tc.getHost());
      boolean isSSL = tc.getQuery().contains(TransportConstants.SSL_ENABLED_PROP_NAME + "=true");
      if (isSSL) {
         hostDetails.put(SCHEME, "amqps");
      } else {
         hostDetails.put(SCHEME, "amqp");
      }
      hostDetails.put(HOSTNAME, tc.getHost());
      hostDetails.put(PORT, tc.getPort());

      connectionProperties.put(FAILOVER_SERVER_LIST, Arrays.asList(hostDetails));
   }
   return ExtCapability.getCapabilities();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:19,代码来源:AMQPConnectionContext.java


示例13: testOneWaySSL

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Test
public void testOneWaySSL() throws Exception {
   createCustomSslServer();
   String text = RandomUtil.randomString();

   tc.getParams().put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PROVIDER_PROP_NAME, storeType);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PATH_PROP_NAME, CLIENT_SIDE_TRUSTSTORE);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, PASSWORD);

   ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc));
   ClientSessionFactory sf = addSessionFactory(createSessionFactory(locator));
   ClientSession session = addClientSession(sf.createSession(false, true, true));
   session.createQueue(CoreClientOverOneWaySSLTest.QUEUE, CoreClientOverOneWaySSLTest.QUEUE, false);
   ClientProducer producer = addClientProducer(session.createProducer(CoreClientOverOneWaySSLTest.QUEUE));

   ClientMessage message = createTextMessage(session, text);
   producer.send(message);

   ClientConsumer consumer = addClientConsumer(session.createConsumer(CoreClientOverOneWaySSLTest.QUEUE));
   session.start();

   ClientMessage m = consumer.receive(1000);
   Assert.assertNotNull(m);
   Assert.assertEquals(text, m.getBodyBuffer().readString());
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:27,代码来源:CoreClientOverOneWaySSLTest.java


示例14: testOneWaySSLUsingDefaultSslContext

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Test
public void testOneWaySSLUsingDefaultSslContext() throws Exception {
   createCustomSslServer();
   String text = RandomUtil.randomString();

   tc.getParams().put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
   tc.getParams().put(TransportConstants.USE_DEFAULT_SSL_CONTEXT_PROP_NAME, true);

   SSLContext.setDefault(SSLSupport.createContext(TransportConstants.DEFAULT_KEYSTORE_PROVIDER, TransportConstants.DEFAULT_KEYSTORE_PATH, TransportConstants.DEFAULT_KEYSTORE_PASSWORD, storeType, CLIENT_SIDE_TRUSTSTORE, PASSWORD));

   ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc));
   ClientSessionFactory sf = addSessionFactory(createSessionFactory(locator));
   ClientSession session = addClientSession(sf.createSession(false, true, true));
   session.createQueue(CoreClientOverOneWaySSLTest.QUEUE, CoreClientOverOneWaySSLTest.QUEUE, false);
   ClientProducer producer = addClientProducer(session.createProducer(CoreClientOverOneWaySSLTest.QUEUE));

   ClientMessage message = createTextMessage(session, text);
   producer.send(message);

   ClientConsumer consumer = addClientConsumer(session.createConsumer(CoreClientOverOneWaySSLTest.QUEUE));
   session.start();

   ClientMessage m = consumer.receive(1000);
   Assert.assertNotNull(m);
   Assert.assertEquals(text, m.getBodyBuffer().readString());
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:27,代码来源:CoreClientOverOneWaySSLTest.java


示例15: testOneWaySSLVerifyHostNegative

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Test
public void testOneWaySSLVerifyHostNegative() throws Exception {
   createCustomSslServer(null, null, false);
   String text = RandomUtil.randomString();

   tc.getParams().put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PROVIDER_PROP_NAME, storeType);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PATH_PROP_NAME, CLIENT_SIDE_TRUSTSTORE);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, PASSWORD);
   tc.getParams().put(TransportConstants.VERIFY_HOST_PROP_NAME, true);

   ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc));

   try {
      ClientSessionFactory sf = addSessionFactory(createSessionFactory(locator));
      fail("Creating a session here should fail due to a certificate with a CN that doesn't match the host name.");
   } catch (Exception e) {
      // ignore
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:21,代码来源:CoreClientOverOneWaySSLTest.java


示例16: testOneWaySSLWithBadClientCipherSuite

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Test
public void testOneWaySSLWithBadClientCipherSuite() throws Exception {
   createCustomSslServer();
   tc.getParams().put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PROVIDER_PROP_NAME, storeType);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PATH_PROP_NAME, CLIENT_SIDE_TRUSTSTORE);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, PASSWORD);
   tc.getParams().put(TransportConstants.ENABLED_CIPHER_SUITES_PROP_NAME, "myBadCipherSuite");

   ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc));
   try {
      createSessionFactory(locator);
      Assert.fail();
   } catch (ActiveMQNotConnectedException e) {
      Assert.assertTrue(true);
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:18,代码来源:CoreClientOverOneWaySSLTest.java


示例17: testOneWaySSLWithMismatchedCipherSuites

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Test
public void testOneWaySSLWithMismatchedCipherSuites() throws Exception {
   createCustomSslServer(getEnabledCipherSuites()[0], "TLSv1.2");
   tc.getParams().put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PROVIDER_PROP_NAME, storeType);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PATH_PROP_NAME, CLIENT_SIDE_TRUSTSTORE);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, PASSWORD);
   tc.getParams().put(TransportConstants.ENABLED_CIPHER_SUITES_PROP_NAME, getEnabledCipherSuites()[1]);
   tc.getParams().put(TransportConstants.ENABLED_PROTOCOLS_PROP_NAME, "TLSv1.2");

   ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc));
   try {
      createSessionFactory(locator);
      Assert.fail();
   } catch (ActiveMQNotConnectedException e) {
      Assert.assertTrue(true);
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:19,代码来源:CoreClientOverOneWaySSLTest.java


示例18: testOneWaySSLWithBadClientProtocol

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Test
public void testOneWaySSLWithBadClientProtocol() throws Exception {
   createCustomSslServer();
   tc.getParams().put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PROVIDER_PROP_NAME, storeType);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PATH_PROP_NAME, CLIENT_SIDE_TRUSTSTORE);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, PASSWORD);
   tc.getParams().put(TransportConstants.ENABLED_PROTOCOLS_PROP_NAME, "myBadProtocol");

   ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc));
   try {
      createSessionFactory(locator);
      Assert.fail();
   } catch (ActiveMQNotConnectedException e) {
      Assert.assertTrue(true);
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:18,代码来源:CoreClientOverOneWaySSLTest.java


示例19: testTCPAllNettyConnectorPropertiesMultiple

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Test
public void testTCPAllNettyConnectorPropertiesMultiple() throws Exception {
   Map<String, Object> props = new HashMap<>();
   Set<String> allowableConnectorKeys = TransportConstants.ALLOWABLE_CONNECTOR_KEYS;
   StringBuilder sb = new StringBuilder();
   sb.append("(tcp://localhost0:61616?");//localhost1:61617,localhost2:61618,localhost3:61619)&ha=true");
   populateConnectorParams(props, allowableConnectorKeys, sb);
   Map<String, Object> props2 = new HashMap<>();
   sb.append(",tcp://localhost1:61617?");
   populateConnectorParams(props2, allowableConnectorKeys, sb);
   Map<String, Object> props3 = new HashMap<>();
   sb.append(",tcp://localhost2:61618?");
   populateConnectorParams(props3, allowableConnectorKeys, sb);
   sb.append(")?ha=true&clientID=myID");

   ActiveMQConnectionFactory factory = parser.newObject(parser.expandURI((sb.toString())), null);

   TransportConfiguration[] staticConnectors = factory.getStaticConnectors();
   Assert.assertEquals(3, staticConnectors.length);
   checkTC(props, staticConnectors[0], 0);
   checkTC(props2, staticConnectors[1], 1);
   checkTC(props3, staticConnectors[2], 2);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:24,代码来源:ConnectionFactoryURITest.java


示例20: testOneWaySSLWithMismatchedProtocols

import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; //导入依赖的package包/类
@Test
public void testOneWaySSLWithMismatchedProtocols() throws Exception {
   createCustomSslServer(null, "TLSv1");
   tc.getParams().put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PROVIDER_PROP_NAME, storeType);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PATH_PROP_NAME, CLIENT_SIDE_TRUSTSTORE);
   tc.getParams().put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, PASSWORD);
   tc.getParams().put(TransportConstants.ENABLED_PROTOCOLS_PROP_NAME, "TLSv1.2");

   ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc));
   try {
      createSessionFactory(locator);
      Assert.fail();
   } catch (ActiveMQNotConnectedException e) {
      Assert.assertTrue(true);
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:18,代码来源:CoreClientOverOneWaySSLTest.java



注:本文中的org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DeleteEdit类代码示例发布时间:2022-05-22
下一篇:
Java HTTPResponse类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap