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

Java InVMAcceptorFactory类代码示例

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

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



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

示例1: before

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@Before
public void before() throws Exception {
  mockTracer.reset();

  org.apache.activemq.artemis.core.config.Configuration configuration = new ConfigurationImpl();

  HashSet<TransportConfiguration> transports = new HashSet<>();
  transports.add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
  configuration.setAcceptorConfigurations(transports);
  configuration.setSecurityEnabled(false);

  File targetDir = new File(System.getProperty("user.dir") + "/target");
  configuration.setBrokerInstance(targetDir);

  server = new ActiveMQServerImpl(configuration);
  server.start();
  ActiveMQJMSConnectionFactory connectionFactory = new ActiveMQJMSConnectionFactory("vm://0");
  connection = connectionFactory.createConnection();

  connection.start();

  session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
}
 
开发者ID:opentracing-contrib,项目名称:java-jms,代码行数:24,代码来源:TracingArtemisTest.java


示例2: start

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
public void start() throws Exception {
  org.apache.activemq.artemis.core.config.Configuration configuration = new ConfigurationImpl();

  HashSet<TransportConfiguration> transports = new HashSet<>();
  transports.add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
  configuration.setAcceptorConfigurations(transports);
  configuration.setSecurityEnabled(false);

  File targetDir = new File(System.getProperty("user.dir") + "/target");
  configuration.setBrokerInstance(targetDir);

  ActiveMQServer temp = new ActiveMQServerImpl(configuration);
  temp.start();

  server = temp;
}
 
开发者ID:opentracing-contrib,项目名称:java-spring-cloud,代码行数:17,代码来源:JmsArtemisManualServerTest.java


示例3: createConfiguration

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
public Configuration createConfiguration() {
	ConfigurationImpl configuration = new ConfigurationImpl();
	configuration.setSecurityEnabled(false);
	configuration.setPersistenceEnabled(this.properties.isPersistent());
	String dataDir = getDataDir();
	configuration.setJournalDirectory(dataDir + "/journal");
	if (this.properties.isPersistent()) {
		configuration.setJournalType(JournalType.NIO);
		configuration.setLargeMessagesDirectory(dataDir + "/largemessages");
		configuration.setBindingsDirectory(dataDir + "/bindings");
		configuration.setPagingDirectory(dataDir + "/paging");
	}
	TransportConfiguration transportConfiguration = new TransportConfiguration(
			InVMAcceptorFactory.class.getName(),
			this.properties.generateTransportParameters());
	configuration.getAcceptorConfigurations().add(transportConfiguration);
	if (this.properties.isDefaultClusterPassword()) {
		logger.debug("Using default Artemis cluster password: "
				+ this.properties.getClusterPassword());
	}
	configuration.setClusterPassword(this.properties.getClusterPassword());
	return configuration;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:24,代码来源:ArtemisEmbeddedConfigurationFactory.java


示例4: createConfiguration

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
public Configuration createConfiguration() {
	ConfigurationImpl configuration = new ConfigurationImpl();
	configuration.setSecurityEnabled(false);
	configuration.setPersistenceEnabled(this.properties.isPersistent());
	String dataDir = getDataDir();
	configuration.setJournalDirectory(dataDir + "/journal");
	if (this.properties.isPersistent()) {
		configuration.setJournalType(JournalType.NIO);
		configuration.setLargeMessagesDirectory(dataDir + "/largemessages");
		configuration.setBindingsDirectory(dataDir + "/bindings");
		configuration.setPagingDirectory(dataDir + "/paging");
	}
	TransportConfiguration transportConfiguration = new TransportConfiguration(
			InVMAcceptorFactory.class.getName(),
			this.properties.generateTransportParameters());
	configuration.getAcceptorConfigurations().add(transportConfiguration);
	if (this.properties.isDefaultClusterPassword()) {
		this.logger.debug("Using default Artemis cluster password: "
				+ this.properties.getClusterPassword());
	}
	configuration.setClusterPassword(this.properties.getClusterPassword());
	return configuration;
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:24,代码来源:ArtemisEmbeddedConfigurationFactory.java


示例5: setup

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@BeforeClass
public static void setup() throws Exception {
   Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));

   activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
   activeMQServer.start();

   HashMap<String, Object> transportConfig = new HashMap<>();

   serverLocator = new ServerLocatorImpl(false, new TransportConfiguration(InVMConnectorFactory.class.getName(), transportConfig));
   sessionFactory = serverLocator.createSessionFactory();
   consumerSessionFactory = serverLocator.createSessionFactory();

   SimpleString addr = SimpleString.toSimpleString("testQueue");
   activeMQServer.addAddressInfo(new AddressInfo(addr, RoutingType.MULTICAST));
   activeMQServer.createQueue(addr, RoutingType.MULTICAST, addr, null, false, false);
   session = sessionFactory.createSession(true, true);
   producer = session.createProducer(addr);
   session.start();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:21,代码来源:RawAckTest.java


示例6: setUp

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
   locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getCanonicalName()));
   testDir = temporaryFolder.getRoot().getAbsolutePath();

   LegacyLDAPSecuritySettingPlugin legacyLDAPSecuritySettingPlugin = new LegacyLDAPSecuritySettingPlugin();
   Map<String, String> map = new HashMap<>();
   map.put(LegacyLDAPSecuritySettingPlugin.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
   map.put(LegacyLDAPSecuritySettingPlugin.CONNECTION_URL, "ldap://localhost:1024");
   map.put(LegacyLDAPSecuritySettingPlugin.CONNECTION_USERNAME, "uid=admin,ou=system");
   map.put(LegacyLDAPSecuritySettingPlugin.CONNECTION_PASSWORD, "secret");
   map.put(LegacyLDAPSecuritySettingPlugin.CONNECTION_PROTOCOL, "s");
   map.put(LegacyLDAPSecuritySettingPlugin.AUTHENTICATION, "simple");
   map.put(LegacyLDAPSecuritySettingPlugin.ENABLE_LISTENER, "true");
   legacyLDAPSecuritySettingPlugin.init(map);

   ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("LDAPLogin");
   Configuration configuration = new ConfigurationImpl().setSecurityEnabled(true).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName())).setJournalDirectory(ActiveMQTestBase.getJournalDir(testDir, 0, false)).setBindingsDirectory(ActiveMQTestBase.getBindingsDir(testDir, 0, false)).setPagingDirectory(ActiveMQTestBase.getPageDir(testDir, 0, false)).setLargeMessagesDirectory(ActiveMQTestBase.getLargeMessagesDir(testDir, 0, false)).setPersistenceEnabled(false).addSecuritySettingPlugin(legacyLDAPSecuritySettingPlugin);

   server = ActiveMQServers.newActiveMQServer(configuration, ManagementFactory.getPlatformMBeanServer(), securityManager, false);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:22,代码来源:LegacyLDAPSecuritySettingPluginListenerTest.java


示例7: createServer

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的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


示例8: testAttributes

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@Test
public void testAttributes() throws Exception {
   TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(), new HashMap<String, Object>(), RandomUtil.randomString());
   acceptorConfig.getParams().put(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME, "password");

   Configuration config = createBasicConfig().addAcceptorConfiguration(acceptorConfig);
   ActiveMQServer service = createServer(false, config);
   service.setMBeanServer(mbeanServer);
   service.start();

   AcceptorControl acceptorControl = createManagementControl(acceptorConfig.getName());

   Assert.assertEquals(acceptorConfig.getName(), acceptorControl.getName());
   Assert.assertEquals(acceptorConfig.getFactoryClassName(), acceptorControl.getFactoryClassName());
   Assert.assertNotEquals(acceptorConfig.getParams().get(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME), acceptorControl.getParameters().get(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME));
   Assert.assertEquals("****", acceptorControl.getParameters().get(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME));
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:18,代码来源:AcceptorControlTest.java


示例9: start

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
public void start() throws Exception {
   System.out.println("\nStarting Embedded");
   if (activeMQServer == null) {
      Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));

      activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
      activeMQServer.start();
   }
   tjws.start();
   manager.setConfiguration(config);
   manager.start();
   tjws.getDeployment().getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
   tjws.getDeployment().getRegistry().addSingletonResource(manager.getTopicManager().getDestination());

}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:16,代码来源:Embedded.java


示例10: startup

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
public static void startup() throws Exception {
   Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));

   activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
   activeMQServer.start();

   deployment = EmbeddedContainer.start();
   manager = new MessageServiceManager(null);
   manager.start();
   deployment.getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
   deployment.getRegistry().addSingletonResource(manager.getTopicManager().getDestination());
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:13,代码来源:PersistentPushQueueConsumerTest.java


示例11: start

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
public void start() throws Exception {
   System.out.println("\nStarting EmbeddedTestServer");
   if (activeMQServer == null) {
      Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));

      activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
      activeMQServer.start();
   }
   tjws.start();
   manager.setConfiguration(config);
   manager.start();
   tjws.getDeployment().getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
   tjws.getDeployment().getRegistry().addSingletonResource(manager.getTopicManager().getDestination());

}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:16,代码来源:EmbeddedTestServer.java


示例12: setup

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@BeforeClass
public static void setup() throws Exception {
   Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));

   server = ActiveMQServers.newActiveMQServer(configuration);
   server.start();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:8,代码来源:PersistentPushTopicConsumerTest.java


示例13: setUp

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
   locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getCanonicalName()));
   testDir = temporaryFolder.getRoot().getAbsolutePath();

   LegacyLDAPSecuritySettingPlugin legacyLDAPSecuritySettingPlugin = new LegacyLDAPSecuritySettingPlugin().setInitialContextFactory("com.sun.jndi.ldap.LdapCtxFactory").setConnectionURL("ldap://localhost:1024").setConnectionUsername("uid=admin,ou=system").setConnectionPassword("secret").setConnectionProtocol("s").setAuthentication("simple");

   ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("LDAPLogin");
   Configuration configuration = new ConfigurationImpl().setSecurityEnabled(true).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName())).setJournalDirectory(ActiveMQTestBase.getJournalDir(testDir, 0, false)).setBindingsDirectory(ActiveMQTestBase.getBindingsDir(testDir, 0, false)).setPagingDirectory(ActiveMQTestBase.getPageDir(testDir, 0, false)).setLargeMessagesDirectory(ActiveMQTestBase.getLargeMessagesDir(testDir, 0, false)).setPersistenceEnabled(false).addSecuritySettingPlugin(legacyLDAPSecuritySettingPlugin);

   server = ActiveMQServers.newActiveMQServer(configuration, ManagementFactory.getPlatformMBeanServer(), securityManager, false);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:13,代码来源:LegacyLDAPSecuritySettingPluginTest.java


示例14: setUp

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
   locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getCanonicalName()));
   testDir = temporaryFolder.getRoot().getAbsolutePath();

   ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("LDAPLogin");
   Configuration configuration = new ConfigurationImpl().setSecurityEnabled(true).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName())).setJournalDirectory(ActiveMQTestBase.getJournalDir(testDir, 0, false)).setBindingsDirectory(ActiveMQTestBase.getBindingsDir(testDir, 0, false)).setPagingDirectory(ActiveMQTestBase.getPageDir(testDir, 0, false)).setLargeMessagesDirectory(ActiveMQTestBase.getLargeMessagesDir(testDir, 0, false));
   server = ActiveMQServers.newActiveMQServer(configuration, ManagementFactory.getPlatformMBeanServer(), securityManager, false);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:10,代码来源:LDAPSecurityTest.java


示例15: testNotifications

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@Test
public void testNotifications() throws Exception {
   TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(), new HashMap<String, Object>(), RandomUtil.randomString());
   TransportConfiguration acceptorConfig2 = new TransportConfiguration(NettyAcceptorFactory.class.getName(), new HashMap<String, Object>(), RandomUtil.randomString());
   Configuration config = createBasicConfig().addAcceptorConfiguration(acceptorConfig).addAcceptorConfiguration(acceptorConfig2);
   ActiveMQServer service = createServer(false, config);
   service.setMBeanServer(mbeanServer);
   service.start();

   AcceptorControl acceptorControl = createManagementControl(acceptorConfig2.getName());

   SimpleNotificationService.Listener notifListener = new SimpleNotificationService.Listener();

   service.getManagementService().addNotificationListener(notifListener);

   Assert.assertEquals(0, notifListener.getNotifications().size());

   acceptorControl.stop();

   Assert.assertEquals(usingCore() ? 5 : 1, notifListener.getNotifications().size());
   Notification notif = notifListener.getNotifications().get(usingCore() ? 2 : 0);
   Assert.assertEquals(CoreNotificationType.ACCEPTOR_STOPPED, notif.getType());
   Assert.assertEquals(NettyAcceptorFactory.class.getName(), notif.getProperties().getSimpleStringProperty(new SimpleString("factory")).toString());

   acceptorControl.start();

   Assert.assertEquals(usingCore() ? 10 : 2, notifListener.getNotifications().size());
   notif = notifListener.getNotifications().get(usingCore() ? 7 : 1);
   Assert.assertEquals(CoreNotificationType.ACCEPTOR_STARTED, notif.getType());
   Assert.assertEquals(NettyAcceptorFactory.class.getName(), notif.getProperties().getSimpleStringProperty(new SimpleString("factory")).toString());
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:32,代码来源:AcceptorControlTest.java


示例16: setUp

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

   Map<String, Object> acceptorParams = new HashMap<>();
   acceptorParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
   TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(), acceptorParams, RandomUtil.randomString());

   TransportConfiguration connectorConfig = new TransportConfiguration(InVMConnectorFactory.class.getName(), acceptorParams, RandomUtil.randomString());

   CoreQueueConfiguration sourceQueueConfig = new CoreQueueConfiguration().setAddress(RandomUtil.randomString()).setName(RandomUtil.randomString()).setDurable(false);
   CoreQueueConfiguration targetQueueConfig = new CoreQueueConfiguration().setAddress(RandomUtil.randomString()).setName(RandomUtil.randomString()).setDurable(false);
   List<String> connectors = new ArrayList<>();
   connectors.add(connectorConfig.getName());

   Configuration conf_1 = createBasicConfig().addAcceptorConfiguration(acceptorConfig).addQueueConfiguration(targetQueueConfig);

   bridgeConfig = new BridgeConfiguration().setName(RandomUtil.randomString()).setQueueName(sourceQueueConfig.getName()).setForwardingAddress(targetQueueConfig.getAddress()).setRetryInterval(RandomUtil.randomPositiveLong()).setRetryIntervalMultiplier(RandomUtil.randomDouble()).setInitialConnectAttempts(RandomUtil.randomPositiveInt()).setReconnectAttempts(RandomUtil.randomPositiveInt()).setReconnectAttemptsOnSameNode(RandomUtil.randomPositiveInt()).setUseDuplicateDetection(RandomUtil.randomBoolean()).setConfirmationWindowSize(RandomUtil.randomPositiveInt()).setStaticConnectors(connectors).setPassword(CLUSTER_PASSWORD);

   Configuration conf_0 = createBasicConfig().addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName())).addConnectorConfiguration(connectorConfig.getName(), connectorConfig).addQueueConfiguration(sourceQueueConfig).addBridgeConfiguration(bridgeConfig);

   server_1 = addServer(ActiveMQServers.newActiveMQServer(conf_1, MBeanServerFactory.createMBeanServer(), false));
   addServer(server_1);
   server_1.start();

   server_0 = addServer(ActiveMQServers.newActiveMQServer(conf_0, mbeanServer, false));
   addServer(server_0);
   server_0.start();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:31,代码来源:BridgeControlTest.java


示例17: setUp

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

   Map<String, Object> acceptorParams = new HashMap<>();
   acceptorParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
   TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(), acceptorParams, RandomUtil.randomString());

   TransportConfiguration connectorConfig = new TransportConfiguration(InVMConnectorFactory.class.getName(), acceptorParams, RandomUtil.randomString());

   CoreQueueConfiguration sourceQueueConfig = new CoreQueueConfiguration().setAddress(RandomUtil.randomString()).setName(RandomUtil.randomString()).setDurable(false);
   CoreQueueConfiguration targetQueueConfig = new CoreQueueConfiguration().setAddress(RandomUtil.randomString()).setName(RandomUtil.randomString()).setDurable(false);
   List<String> connectors = new ArrayList<>();
   connectors.add(connectorConfig.getName());
   bridgeConfig = new BridgeConfiguration().setName(RandomUtil.randomString()).setQueueName(sourceQueueConfig.getName()).setForwardingAddress(targetQueueConfig.getAddress()).setRetryInterval(RandomUtil.randomPositiveLong()).setRetryIntervalMultiplier(RandomUtil.randomDouble()).setInitialConnectAttempts(RandomUtil.randomPositiveInt()).setReconnectAttempts(RandomUtil.randomPositiveInt()).setReconnectAttemptsOnSameNode(RandomUtil.randomPositiveInt()).setUseDuplicateDetection(RandomUtil.randomBoolean()).setConfirmationWindowSize(RandomUtil.randomPositiveInt()).setStaticConnectors(connectors);

   Configuration conf_1 = createBasicConfig().addAcceptorConfiguration(acceptorConfig).addQueueConfiguration(targetQueueConfig);

   Configuration conf_0 = createBasicConfig().addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY)).addConnectorConfiguration(connectorConfig.getName(), connectorConfig).addQueueConfiguration(sourceQueueConfig).addBridgeConfiguration(bridgeConfig);

   server_1 = addServer(ActiveMQServers.newActiveMQServer(conf_1, MBeanServerFactory.createMBeanServer(), false));
   server_1.start();

   server_0 = addServer(ActiveMQServers.newActiveMQServer(conf_0, mbeanServer, false));
   server_0.start();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:28,代码来源:BridgeControlUsingCoreTest.java


示例18: setUp

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

   Map<String, Object> acceptorParams = new HashMap<>();
   acceptorParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
   TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(), acceptorParams, RandomUtil.randomString());

   TransportConfiguration connectorConfig = new TransportConfiguration(InVMConnectorFactory.class.getName(), acceptorParams, RandomUtil.randomString());

   CoreQueueConfiguration queueConfig = new CoreQueueConfiguration().setAddress(RandomUtil.randomString()).setName(RandomUtil.randomString()).setDurable(false);
   List<String> connectors = new ArrayList<>();
   connectors.add(connectorConfig.getName());

   String discoveryGroupName = RandomUtil.randomString();
   DiscoveryGroupConfiguration discoveryGroupConfig = new DiscoveryGroupConfiguration().setName(discoveryGroupName).setRefreshTimeout(500).setDiscoveryInitialWaitTimeout(0).setBroadcastEndpointFactory(new UDPBroadcastEndpointFactory().setGroupAddress(getUDPDiscoveryAddress()).setGroupPort(getUDPDiscoveryPort()));

   Configuration conf_1 = createBasicConfig().addAcceptorConfiguration(acceptorConfig).addQueueConfiguration(queueConfig);

   clusterConnectionConfig1 = new ClusterConnectionConfiguration().setName(RandomUtil.randomString()).setAddress(queueConfig.getAddress()).setConnectorName(connectorConfig.getName()).setRetryInterval(RandomUtil.randomPositiveLong()).setDuplicateDetection(RandomUtil.randomBoolean()).setMessageLoadBalancingType(MessageLoadBalancingType.STRICT).setMaxHops(RandomUtil.randomPositiveInt()).setConfirmationWindowSize(RandomUtil.randomPositiveInt()).setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND).setStaticConnectors(connectors);

   clusterConnectionConfig2 = new ClusterConnectionConfiguration().setName(RandomUtil.randomString()).setAddress(queueConfig.getAddress()).setConnectorName(connectorConfig.getName()).setRetryInterval(RandomUtil.randomPositiveLong()).setDuplicateDetection(RandomUtil.randomBoolean()).setMessageLoadBalancingType(MessageLoadBalancingType.OFF).setMaxHops(RandomUtil.randomPositiveInt()).setConfirmationWindowSize(RandomUtil.randomPositiveInt()).setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND).setDiscoveryGroupName(discoveryGroupName);

   Configuration conf_0 = createBasicConfig().addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName())).addConnectorConfiguration(connectorConfig.getName(), connectorConfig).addClusterConfiguration(clusterConnectionConfig1).addClusterConfiguration(clusterConnectionConfig2).addDiscoveryGroupConfiguration(discoveryGroupName, discoveryGroupConfig);

   mbeanServer_1 = MBeanServerFactory.createMBeanServer();
   server_1 = addServer(ActiveMQServers.newActiveMQServer(conf_1, mbeanServer_1, false));
   server_1.start();

   server_0 = addServer(ActiveMQServers.newActiveMQServer(conf_0, mbeanServer, false));
   server_0.start();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:34,代码来源:ClusterConnectionControlTest.java


示例19: scaleDown

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
protected void scaleDown(ScaleDownHandler handler) throws Exception {
   SimpleString address = new SimpleString("testQueue");
   HashMap<String, Object> params = new HashMap<>();
   params.put(TransportConstants.SERVER_ID_PROP_NAME, "2");
   Configuration config = createDefaultInVMConfig(2).clearAcceptorConfigurations().addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName(), params)).setSecurityEnabled(false);
   ActiveMQServer server2 = addServer(ActiveMQServers.newActiveMQServer(config, null, true));

   this.conf.clearConnectorConfigurations().addConnectorConfiguration("server2-connector", new TransportConfiguration(INVM_CONNECTOR_FACTORY, params));

   server2.start();
   server.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST));
   server.createQueue(address, RoutingType.ANYCAST, address, null, true, false, -1, false, false);
   server2.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST));
   server2.createQueue(address, RoutingType.ANYCAST, address, null, true, false, -1, false, false);
   ServerLocator locator = createInVMNonHALocator();
   ClientSessionFactory csf = createSessionFactory(locator);
   ClientSession session = csf.createSession();
   ClientProducer producer = session.createProducer(address);
   for (int i = 0; i < 100; i++) {
      ClientMessage message = session.createMessage(true);
      message.getBodyBuffer().writeString("m" + i);
      producer.send(message);
   }

   ActiveMQServerControl managementControl = createManagementControl();
   handler.scaleDown(managementControl);
   locator.close();
   locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(INVM_CONNECTOR_FACTORY, params)));
   csf = createSessionFactory(locator);
   session = csf.createSession();
   session.start();
   ClientConsumer consumer = session.createConsumer(address);
   for (int i = 0; i < 100; i++) {
      ClientMessage m = consumer.receive(5000);
      assertNotNull(m);
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:38,代码来源:ActiveMQServerControlTest.java


示例20: createServer

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
private ActiveMQServer 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);
   TransportConfiguration stompTransport = new TransportConfiguration(NettyAcceptorFactory.class.getName(), params);

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

   return addServer(ActiveMQServers.newActiveMQServer(config));
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:11,代码来源:StompStressTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java RolePermissionResolver类代码示例发布时间:2022-05-22
下一篇:
Java Locator2Impl类代码示例发布时间: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