Package org.hornetq.core.config

Examples of org.hornetq.core.config.DiscoveryGroupConfiguration


      if (cf == null)
      {
         if (cfConfig.getDiscoveryGroupName() != null)
         {
            DiscoveryGroupConfiguration groupConfig = server.getConfiguration().getDiscoveryGroupConfigurations().get(cfConfig.getDiscoveryGroupName());
           
            if (groupConfig == null)
            {
               throw new HornetQException(HornetQException.ILLEGAL_STATE, "Discovery Group '" + cfConfig.getDiscoveryGroupName() + "' doesn't exist on maing config");
            }
View Full Code Here


            Assert.assertEquals("backup-connector", bc.getConnectorInfos().get(0).b);
         }
      }

      Assert.assertEquals(2, conf.getDiscoveryGroupConfigurations().size());
      DiscoveryGroupConfiguration dc = conf.getDiscoveryGroupConfigurations().get("dg1");
      Assert.assertEquals("dg1", dc.getName());
      Assert.assertEquals("192.168.0.120", dc.getGroupAddress());
      assertEquals("172.16.8.10", dc.getLocalBindAddress());
      Assert.assertEquals(11999, dc.getGroupPort());
      Assert.assertEquals(12345, dc.getRefreshTimeout());

      dc = conf.getDiscoveryGroupConfigurations().get("dg2");
      Assert.assertEquals("dg2", dc.getName());
      Assert.assertEquals("192.168.0.121", dc.getGroupAddress());
      assertEquals("172.16.8.11", dc.getLocalBindAddress());
      Assert.assertEquals(12999, dc.getGroupPort());
      Assert.assertEquals(23456, dc.getRefreshTimeout());

      Assert.assertEquals(2, conf.getDivertConfigurations().size());
      for (DivertConfiguration dic : conf.getDivertConfigurations())
      {
         if (dic.getName().equals("divert1"))
View Full Code Here

                                                                             1000,
                                                                             connectorPairs);

      configuration.getBroadcastGroupConfigurations().add(bcConfig);

      DiscoveryGroupConfiguration dcConfig = new DiscoveryGroupConfiguration("dg1", null, groupAddress, port, 5000);

      configuration.getDiscoveryGroupConfigurations().put(dcConfig.getName(), dcConfig);

      HornetQServer server;

      if (fileStorage)
      {
View Full Code Here

      config = new ConfigurationImpl();
      config.getConnectorConfigurations().put("netty",
                                              new TransportConfiguration(NettyConnectorFactory.class.getName()));
     
      DiscoveryGroupConfiguration dcg = new DiscoveryGroupConfiguration("mygroup", "172.16.8.10",
                                                                        "243.7.7.7", 12345,
                                                                        5432);
      config.getDiscoveryGroupConfigurations().put("mygroup", dcg);
      HornetQServer server = createServer(false, config);
View Full Code Here

                                                                                         -1,
                                                                                         groupAddress,
                                                                                         groupPort,
                                                                                         250,
                                                                                         connectorInfos);
      DiscoveryGroupConfiguration discoveryGroupConfig = new DiscoveryGroupConfiguration(discoveryName,
                                                                                         null,
                                                                                         groupAddress,
                                                                                         groupPort,
                                                                                         HornetQClient.DEFAULT_DISCOVERY_REFRESH_TIMEOUT);
View Full Code Here

      Configuration conf = new ConfigurationImpl();
      conf.setSecurityEnabled(false);
      conf.setJMXManagementEnabled(true);
      conf.getDiscoveryGroupConfigurations()
          .put("discovery",
               new DiscoveryGroupConfiguration("discovery",
                                               null,
                                               "231.7.7.7",
                                               discoveryPort,
                                               ConfigurationImpl.DEFAULT_BROADCAST_REFRESH_TIMEOUT));
      HornetQServer server = HornetQServers.newHornetQServer(conf, mbeanServer, false);
View Full Code Here

   // Public --------------------------------------------------------

   public void testAttributes() throws Exception
   {
      DiscoveryGroupConfiguration discoveryGroupConfig = new DiscoveryGroupConfiguration(RandomUtil.randomString(),
                                                                                         null,
                                                                                         "231.7.7.7",
                                                                                         2000,
                                                                                         RandomUtil.randomPositiveLong());

      Configuration conf = new ConfigurationImpl();
      conf.setSecurityEnabled(false);
      conf.setJMXManagementEnabled(true);
      conf.setClustered(true);
      conf.getDiscoveryGroupConfigurations().put(discoveryGroupConfig.getName(), discoveryGroupConfig);
      conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
      service = HornetQServers.newHornetQServer(conf, mbeanServer, false);
      service.start();

      DiscoveryGroupControl discoveryGroupControl = createManagementControl(discoveryGroupConfig.getName());

      Assert.assertEquals(discoveryGroupConfig.getName(), discoveryGroupControl.getName());
      Assert.assertEquals(discoveryGroupConfig.getGroupAddress(), discoveryGroupControl.getGroupAddress());
      Assert.assertEquals(discoveryGroupConfig.getGroupPort(), discoveryGroupControl.getGroupPort());
      Assert.assertEquals(discoveryGroupConfig.getRefreshTimeout(), discoveryGroupControl.getRefreshTimeout());
   }
View Full Code Here

      Assert.assertEquals(discoveryGroupConfig.getRefreshTimeout(), discoveryGroupControl.getRefreshTimeout());
   }

   public void testStartStop() throws Exception
   {
      DiscoveryGroupConfiguration discoveryGroupConfig = new DiscoveryGroupConfiguration(RandomUtil.randomString(),
                                                                                         null,
                                                                                         "231.7.7.7",
                                                                                         2000,
                                                                                         RandomUtil.randomPositiveLong());

      Configuration conf = new ConfigurationImpl();
      conf.setSecurityEnabled(false);
      conf.setJMXManagementEnabled(true);
      conf.setClustered(true);
      conf.getDiscoveryGroupConfigurations().put(discoveryGroupConfig.getName(), discoveryGroupConfig);
      conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
      service = HornetQServers.newHornetQServer(conf, mbeanServer, false);
      service.start();

      DiscoveryGroupControl discoveryGroupControl = createManagementControl(discoveryGroupConfig.getName());

      // started by the server
      Assert.assertTrue(discoveryGroupControl.isStarted());

      discoveryGroupControl.stop();
View Full Code Here

                                                                             250,
                                                                             connectorPairs);

      server0.getConfiguration().getBroadcastGroupConfigurations().add(bcConfig);

      DiscoveryGroupConfiguration dcConfig = new DiscoveryGroupConfiguration("dg1", null, groupAddress, port, 5000);

      server0.getConfiguration().getDiscoveryGroupConfigurations().put(dcConfig.getName(), dcConfig);

      final String bridgeName = "bridge1";

      BridgeConfiguration bridgeConfiguration = new BridgeConfiguration(bridgeName,
                                                                        queueName0,
View Full Code Here

      else if (discoveryAddress != null)
      {
         Integer discoveryPort = overrideProperties.getDiscoveryPort() != null ? overrideProperties.getDiscoveryPort()
                                                                              : getDiscoveryPort();

         DiscoveryGroupConfiguration groupConfiguration = new DiscoveryGroupConfiguration(discoveryAddress, discoveryPort);

         long refreshTimeout = overrideProperties.getDiscoveryRefreshTimeout() != null ? overrideProperties.getDiscoveryRefreshTimeout()
                                                                    : raProperties.getDiscoveryRefreshTimeout();

         long initialTimeout = overrideProperties.getDiscoveryInitialWaitTimeout() != null ? overrideProperties.getDiscoveryInitialWaitTimeout()
                                                                        : raProperties.getDiscoveryInitialWaitTimeout();

         groupConfiguration.setDiscoveryInitialWaitTimeout(initialTimeout);

         groupConfiguration.setRefreshTimeout(refreshTimeout);

         if (ha)
         {
            cf = HornetQJMSClient.createConnectionFactoryWithHA(groupConfiguration, JMSFactoryType.XA_CF);
         }
View Full Code Here

TOP

Related Classes of org.hornetq.core.config.DiscoveryGroupConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.