예제 #1
0
  protected void createReplicatedConfigs() throws Exception {
    nodeManager = new InVMNodeManager();

    final TransportConfiguration liveConnector = getConnectorTransportConfiguration(true);
    final TransportConfiguration backupConnector = getConnectorTransportConfiguration(false);
    final TransportConfiguration backupAcceptor = getAcceptorTransportConfiguration(false);

    nodeManager = new InVMNodeManager();
    backupConfig = createDefaultConfig();
    liveConfig = createDefaultConfig();

    ReplicatedBackupUtils.configureReplicationPair(
        backupConfig, backupConnector, backupAcceptor, liveConfig, liveConnector);

    final String sufix = "_backup";
    backupConfig.setBindingsDirectory(backupConfig.getBindingsDirectory() + sufix);
    backupConfig.setJournalDirectory(backupConfig.getJournalDirectory() + sufix);
    backupConfig.setPagingDirectory(backupConfig.getPagingDirectory() + sufix);
    backupConfig.setLargeMessagesDirectory(backupConfig.getLargeMessagesDirectory() + sufix);
    backupConfig.setSecurityEnabled(false);

    backupServer = createTestableServer(backupConfig);
    liveConfig.getAcceptorConfigurations().clear();
    liveConfig.getAcceptorConfigurations().add(getAcceptorTransportConfiguration(true));

    liveServer = createTestableServer(liveConfig);
  }
예제 #2
0
  public ConnectionEntry createConnectionEntry(
      final Acceptor acceptorUsed, final Connection connection) {
    final Configuration config = server.getConfiguration();

    Executor connectionExecutor = server.getExecutorFactory().getExecutor();

    final CoreRemotingConnection rc =
        new RemotingConnectionImpl(
            connection,
            interceptors,
            config.isAsyncConnectionExecutionEnabled() ? connectionExecutor : null,
            server.getNodeID());

    Channel channel1 = rc.getChannel(CHANNEL_ID.SESSION.id, -1);

    ChannelHandler handler = new HornetQPacketHandler(this, server, channel1, rc);

    channel1.setHandler(handler);

    long ttl = HornetQClient.DEFAULT_CONNECTION_TTL;

    if (config.getConnectionTTLOverride() != -1) {
      ttl = config.getConnectionTTLOverride();
    }

    final ConnectionEntry entry =
        new ConnectionEntry(rc, connectionExecutor, System.currentTimeMillis(), ttl);

    final Channel channel0 = rc.getChannel(0, -1);

    channel0.setHandler(new LocalChannelHandler(config, entry, channel0, acceptorUsed, rc));

    return entry;
  }
예제 #3
0
  // XXX HORNETQ-720 + cluster fixes: needs review
  @Override
  public void announceReplicatingBackup(Channel liveChannel) {
    List<ClusterConnectionConfiguration> configs = this.configuration.getClusterConfigurations();
    if (!configs.isEmpty()) {
      ClusterConnectionConfiguration config = configs.get(0);

      TransportConfiguration connector =
          configuration.getConnectorConfigurations().get(config.getConnectorName());

      if (connector == null) {
        log.warn(
            "No connector with name '"
                + config.getConnectorName()
                + "'. backup cannot be announced.");
        return;
      }
      liveChannel.send(
          new BackupRegistrationMessage(
              nodeUUID.toString(),
              connector,
              configuration.getClusterUser(),
              configuration.getClusterPassword()));
    } else {
      log.warn("no cluster connections defined, unable to announce backup");
    }
  }
예제 #4
0
  /**
   * Creates and configures a new instance.
   *
   * @param dataDirectory root directory where persistent messages are stored
   * @param useLibAio true to use libaio, false if not installed. See <a
   *     href="http://docs.jboss.org/hornetq/2.2.5.Final/user-manual/en/html/libaio.html">Libaio
   *     Native Libraries</a>
   * @param injector Google Guice injector. Used to inject dependency members into commands if
   *     needed.
   * @param queueConfigs vararg of QueueConfig> instances.
   */
  public HornetNest(
      String dataDirectory, boolean useLibAio, Injector injector, QueueConfig... queueConfigs) {
    jmsServer = new EmbeddedJMS();
    config = new ConfigurationImpl();
    jmsConfig = new JMSConfigurationImpl();

    try {
      configureLocations(dataDirectory);
      configureAcceptor();
      configureConnectionFactory();
      configurePaging();
      config.setJournalType(useLibAio ? JournalType.ASYNCIO : JournalType.NIO);
      configureQueues(queueConfigs);

      config.setThreadPoolMaxSize(-1);
      config.setScheduledThreadPoolMaxSize(10);
      jmsServer.setConfiguration(config);
      jmsServer.setJmsConfiguration(jmsConfig);
      jmsServer.start();

      ConnectionFactory connectionFactory = (ConnectionFactory) jmsServer.lookup("/cf");
      if (connectionFactory == null) {
        throw new HornetNestException(
            "Failed to start EmbeddedJMS due to previous errors. Please, see earlier output from HornetQ.");
      }
      consumerConnection = connectionFactory.createConnection();
      producerConnection = connectionFactory.createConnection();
      configureListeners(injector, queueConfigs);
    } catch (HornetNestException e) {
      throw e;
    } catch (Exception e) {
      throw new HornetNestException("Failed to start EmbeddedJMS", e);
    }
  }
예제 #5
0
  public synchronized void start() throws Exception {
    if (started) {
      return;
    }

    for (BroadcastGroup group : broadcastGroups.values()) {
      if (!backup) {
        group.start();
      }
    }

    for (ClusterConnection conn : clusterConnections.values()) {
      conn.start();
      if (backup && configuration.isSharedStore()) {
        conn.informTopology();
        conn.announceBackup();
      }
    }

    for (BridgeConfiguration config : configuration.getBridgeConfigurations()) {
      deployBridge(config, !backup);
    }

    started = true;
  }
예제 #6
0
  protected static Configuration createClusteredDefaultConfig(
      final int index, final Map<String, Object> params, final String... acceptors) {
    Configuration config = createDefaultConfig(index, params, acceptors);

    config.setClustered(true);

    return config;
  }
예제 #7
0
  public void testParsing() throws Exception {
    Configuration config = createDefaultConfig();

    // anything so the parsing will work
    config.getConnectorConfigurations().put("netty", new TransportConfiguration());

    JMSServerConfigParser parser = new JMSServerConfigParserImpl();

    String conf = "hornetq-jms-for-JMSServerDeployerTest.xml";
    URL confURL = Thread.currentThread().getContextClassLoader().getResource(conf);

    InputStream stream = confURL.openStream();

    JMSConfiguration jmsconfig = parser.parseConfiguration(stream);
    stream.close();

    ConnectionFactoryConfiguration cfConfig = jmsconfig.getConnectionFactoryConfigurations().get(0);

    assertEquals(1234, cfConfig.getClientFailureCheckPeriod());
    assertEquals(5678, cfConfig.getCallTimeout());
    assertEquals(12345, cfConfig.getConsumerWindowSize());
    assertEquals(6789, cfConfig.getConsumerMaxRate());
    assertEquals(123456, cfConfig.getConfirmationWindowSize());
    assertEquals(7712652, cfConfig.getProducerWindowSize());
    assertEquals(789, cfConfig.getProducerMaxRate());
    assertEquals(12, cfConfig.getMinLargeMessageSize());
    assertEquals(true, cfConfig.isCompressLargeMessages());
    assertEquals("TestClientID", cfConfig.getClientID());
    assertEquals(3456, cfConfig.getDupsOKBatchSize());
    assertEquals(4567, cfConfig.getTransactionBatchSize());
    assertEquals(true, cfConfig.isBlockOnAcknowledge());
    assertEquals(false, cfConfig.isBlockOnNonDurableSend());
    assertEquals(true, cfConfig.isBlockOnDurableSend());
    assertEquals(false, cfConfig.isAutoGroup());
    assertEquals(true, cfConfig.isPreAcknowledge());
    assertEquals(2345, cfConfig.getConnectionTTL());
    assertEquals("FooClass", cfConfig.getLoadBalancingPolicyClassName());
    assertEquals(34, cfConfig.getReconnectAttempts());
    assertEquals(5, cfConfig.getRetryInterval());
    assertEquals(6.0, cfConfig.getRetryIntervalMultiplier());
    assertEquals(300, cfConfig.getMaxRetryInterval());
    assertEquals(true, cfConfig.isCacheLargeMessagesClient());

    assertEquals(1, jmsconfig.getQueueConfigurations().size());

    JMSQueueConfiguration queueConfig = jmsconfig.getQueueConfigurations().get(0);
    assertEquals("fullConfigurationQueue", queueConfig.getName());
    assertEquals(2, queueConfig.getBindings().length);
    assertEquals("/fullConfigurationQueue", queueConfig.getBindings()[0]);
    assertEquals("/queue/fullConfigurationQueue", queueConfig.getBindings()[1]);

    assertEquals(1, jmsconfig.getTopicConfigurations().size());
    TopicConfiguration topicConfig = jmsconfig.getTopicConfigurations().get(0);
    assertEquals("fullConfigurationTopic", topicConfig.getName());
    assertEquals(2, topicConfig.getBindings().length);
    assertEquals("/fullConfigurationTopic", topicConfig.getBindings()[0]);
    assertEquals("/topic/fullConfigurationTopic", topicConfig.getBindings()[1]);
  }
예제 #8
0
 private void configureLocations(String dataDirectory) {
   if (dataDirectory == null || !new File(dataDirectory).exists()) {
     throw new HornetNestException("Must provide data directory that exists");
   }
   config.setBindingsDirectory(dataDirectory + "/bindings");
   config.setJournalDirectory(dataDirectory + "/journal");
   config.setLargeMessagesDirectory(dataDirectory + "/largemessages");
   config.setPagingDirectory(dataDirectory + "/paging");
 }
예제 #9
0
 private void configureAcceptor() {
   config.setPersistenceEnabled(true);
   config.setSecurityEnabled(false);
   config
       .getAcceptorConfigurations()
       .add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
   config
       .getConnectorConfigurations()
       .put("connector", new TransportConfiguration(InVMConnectorFactory.class.getName()));
 }
예제 #10
0
  protected void createConfigs() throws Exception {
    nodeManager = new InVMNodeManager();

    backupConfig = super.createDefaultConfig();
    backupConfig.getAcceptorConfigurations().clear();
    backupConfig.getAcceptorConfigurations().add(getAcceptorTransportConfiguration(false));
    backupConfig.setSharedStore(true);
    backupConfig.setBackup(true);
    backupConfig.setClustered(true);
    TransportConfiguration liveConnector = getConnectorTransportConfiguration(true);
    TransportConfiguration backupConnector = getConnectorTransportConfiguration(false);
    backupConfig.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
    backupConfig.getConnectorConfigurations().put(backupConnector.getName(), backupConnector);
    ReplicatedBackupUtils.createClusterConnectionConf(
        backupConfig, backupConnector.getName(), liveConnector.getName());
    backupServer = createTestableServer(backupConfig);

    liveConfig = super.createDefaultConfig();
    liveConfig.getAcceptorConfigurations().clear();
    liveConfig.getAcceptorConfigurations().add(getAcceptorTransportConfiguration(true));
    liveConfig.setSharedStore(true);
    liveConfig.setClustered(true);
    ReplicatedBackupUtils.createClusterConnectionConf(liveConfig, liveConnector.getName());
    liveConfig.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
    liveServer = createTestableServer(liveConfig);
  }
예제 #11
0
  public synchronized void deploy() throws Exception {
    if (clustered) {
      for (BroadcastGroupConfiguration config : configuration.getBroadcastGroupConfigurations()) {
        deployBroadcastGroup(config);
      }

      for (ClusterConnectionConfiguration config : configuration.getClusterConfigurations()) {
        deployClusterConnection(config);
      }
    }
  }
  @BeforeClass
  public static void setup() throws Exception {
    Configuration configuration = new ConfigurationImpl();
    configuration.setPersistenceEnabled(false);
    configuration.setSecurityEnabled(false);
    configuration
        .getAcceptorConfigurations()
        .add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));

    server = HornetQServers.newHornetQServer(configuration);
    server.start();
  }
예제 #13
0
  protected static Configuration createDefaultConfig(
      final int index, final Map<String, Object> params, final String... acceptors) {
    Configuration configuration = createBasicConfig(index);

    configuration.getAcceptorConfigurations().clear();

    for (String acceptor : acceptors) {
      TransportConfiguration transportConfig = new TransportConfiguration(acceptor, params);
      configuration.getAcceptorConfigurations().add(transportConfig);
    }

    return configuration;
  }
  private HornetQServer createServer2() throws Exception {
    // Server1 with two acceptors, each acceptor on a different cluster connection
    // talking to a different connector.
    // i.e. two cluster connections isolated on the same node
    Configuration config1 = createBasicConfig(3);

    Map<String, Object> params = new HashMap<String, Object>();
    params.put(TransportConstants.CLUSTER_CONNECTION, "cc1");
    params.put(org.hornetq.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "3");

    TransportConfiguration acceptor1VM1 =
        new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY, params, "acceptor-cc1");
    config1.getAcceptorConfigurations().add(acceptor1VM1);

    config1
        .getConnectorConfigurations()
        .put("local-cc1", createInVMTransportConnectorConfig(3, "local-cc1"));
    config1
        .getConnectorConfigurations()
        .put("local-cc2", createInVMTransportConnectorConfig(4, "local-cc2"));

    config1
        .getConnectorConfigurations()
        .put("other-cc1", createInVMTransportConnectorConfig(1, "other-cc1"));
    config1
        .getConnectorConfigurations()
        .put("other-cc2", createInVMTransportConnectorConfig(2, "other-cc2"));

    params = new HashMap<String, Object>();
    params.put(TransportConstants.CLUSTER_CONNECTION, "cc2");
    params.put(org.hornetq.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "4");

    TransportConfiguration acceptor2VM1 =
        new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY, params, "acceptor-cc2");
    config1.getAcceptorConfigurations().add(acceptor2VM1);

    List<String> connectTo = new ArrayList<String>();
    connectTo.add("other-cc1");

    ClusterConnectionConfiguration server1CC1 =
        new ClusterConnectionConfiguration(
            "cc1", "jms", "local-cc1", 250, true, false, 1, 1024, connectTo, false);

    config1.getClusterConfigurations().add(server1CC1);

    ArrayList<String> connectTo2 = new ArrayList<String>();
    connectTo2.add("other-cc2");

    ClusterConnectionConfiguration server1CC2 =
        new ClusterConnectionConfiguration(
            "cc2", "jms", "local-cc2", 250, true, false, 1, 1024, connectTo2, false);

    config1.getClusterConfigurations().add(server1CC2);

    return createServer(false, config1);
  }
예제 #15
0
  @Override
  @Before
  public void setUp() throws Exception {
    super.setUp();

    // Start the servers
    Configuration conf0 = createBasicConfig();
    conf0.setJournalDirectory(getJournalDir(0, false));
    conf0.setBindingsDirectory(getBindingsDir(0, false));
    conf0.setSecurityEnabled(false);
    conf0.getAcceptorConfigurations().add(new TransportConfiguration(INVM_ACCEPTOR_FACTORY));
    server0 = addServer(HornetQServers.newHornetQServer(conf0, false));

    context0 = new InVMNamingContext();
    jmsServer0 = new JMSServerManagerImpl(server0);
    jmsServer0.setContext(context0);
    jmsServer0.start();

    Configuration conf1 = createBasicConfig();
    conf1.setSecurityEnabled(false);
    conf1.setJournalDirectory(getJournalDir(1, false));
    conf1.setBindingsDirectory(getBindingsDir(1, false));
    params1 = new HashMap<String, Object>();
    params1.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
    conf1
        .getAcceptorConfigurations()
        .add(new TransportConfiguration(INVM_ACCEPTOR_FACTORY, params1));

    server1 = addServer(HornetQServers.newHornetQServer(conf1, false));

    context1 = new InVMNamingContext();

    jmsServer1 = new JMSServerManagerImpl(server1);
    jmsServer1.setContext(context1);
    jmsServer1.start();

    createQueue("sourceQueue", 0);

    jmsServer0.createTopic(false, "sourceTopic", "/topic/sourceTopic");

    createQueue("localTargetQueue", 0);

    createQueue("targetQueue", 1);

    setUpAdministeredObjects();
    TxControl.enable();
    // We need a local transaction and recovery manager
    // We must start this after the remote servers have been created or it won't
    // have deleted the database and the recovery manager may attempt to recover transactions

  }
예제 #16
0
  /** @throws Exception */
  protected void initServer() throws Exception {
    configuration = createDefaultConfig();
    configuration.setSecurityEnabled(false);
    configuration.setJournalMinFiles(2);
    server = createServer(true, configuration);
    server.start();

    AddressSettings qs = server.getAddressSettingsRepository().getMatch("*");
    AddressSettings newSets = new AddressSettings();
    newSets.setRedeliveryDelay(DelayedMessageTest.DELAY);
    newSets.merge(qs);
    server.getAddressSettingsRepository().addMatch(qName, newSets);
    locator = createInVMNonHALocator();
  }
예제 #17
0
  protected void startServer() throws Exception {
    Configuration config = createDefaultConfig();
    config.setJournalFileSize(HornetQDefaultConfiguration.DEFAULT_JOURNAL_FILE_SIZE);
    config.setJournalCompactMinFiles(HornetQDefaultConfiguration.DEFAULT_JOURNAL_COMPACT_MIN_FILES);
    config.setJournalCompactPercentage(
        HornetQDefaultConfiguration.DEFAULT_JOURNAL_COMPACT_PERCENTAGE);
    config.setJournalMinFiles(2);

    server = super.createServer(true, config);

    server.start();
    locator = createInVMNonHALocator();
    factory = createSessionFactory(locator);
  }
예제 #18
0
  public void testConnection(
      final String acceptorHost, final String connectorHost, final boolean mustConnect)
      throws Exception {
    System.out.println(
        "acceptor="
            + acceptorHost
            + ", connector="
            + connectorHost
            + ", mustConnect="
            + mustConnect);

    Map<String, Object> params = new HashMap<String, Object>();
    params.put(getHostPropertyKey(), acceptorHost);
    TransportConfiguration acceptorConfig =
        new TransportConfiguration(getAcceptorFactoryClassName(), params);
    Set<TransportConfiguration> transportConfigs = new HashSet<TransportConfiguration>();
    transportConfigs.add(acceptorConfig);

    Configuration config = createDefaultConfig(true);
    config.setAcceptorConfigurations(transportConfigs);
    HornetQServer messagingService = createServer(false, config);
    messagingService.start();

    params = new HashMap<String, Object>();
    params.put(getHostPropertyKey(), connectorHost);
    TransportConfiguration connectorConfig =
        new TransportConfiguration(getConnectorFactoryClassName(), params);

    try {
      ClientSessionFactory sf = HornetQClient.createClientSessionFactory(connectorConfig);

      if (mustConnect) {
        ClientSession session = sf.createSession(false, true, true);
        session.close();
        System.out.println("connection OK");
      } else {
        try {
          sf.createSession(false, true, true);
          Assert.fail(
              "session creation must fail because connector must not be able to connect to the server bound to another network interface");
        } catch (Exception e) {
        }
      }
    } finally {
      if (messagingService != null) {
        messagingService.stop();
      }
    }
  }
예제 #19
0
  protected void startServer() throws Exception {
    Configuration config = createDefaultConfig();
    config.setJournalFileSize(HornetQDefaultConfiguration.getDefaultJournalFileSize());
    config.setJournalCompactMinFiles(
        HornetQDefaultConfiguration.getDefaultJournalCompactMinFiles());
    config.setJournalCompactPercentage(
        HornetQDefaultConfiguration.getDefaultJournalCompactPercentage());
    config.setJournalMinFiles(2);

    server = super.createServer(true, config);

    server.start();
    locator = createInVMNonHALocator();
    factory = createSessionFactory(locator);
  }
예제 #20
0
  public synchronized void deploy() throws Exception {
    if (state == State.STOPPED) {
      state = State.DEPLOYED;
    } else {
      throw new IllegalStateException();
    }

    for (BroadcastGroupConfiguration config : configuration.getBroadcastGroupConfigurations()) {
      deployBroadcastGroup(config);
    }

    for (ClusterConnectionConfiguration config : configuration.getClusterConfigurations()) {
      deployClusterConnection(config);
    }
  }
예제 #21
0
  @Override
  @Before
  public void setUp() throws Exception {
    super.setUp();

    configuration = createDefaultConfig();
    configuration.setSecurityEnabled(false);
    server = createServer(true, configuration);
    // start the server
    server.start();

    qs = new AddressSettings();
    qs.setLastValueQueue(true);
    server.getAddressSettingsRepository().addMatch(address.toString(), qs);
    // then we create a client as normal
    locator =
        HornetQClient.createServerLocatorWithoutHA(
            new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));

    locator.setBlockOnAcknowledge(true);
    locator.setAckBatchSize(0);
    ClientSessionFactory sessionFactory = createSessionFactory(locator);
    clientSession = sessionFactory.createSession(false, true, true);
    clientSessionXa = sessionFactory.createSession(true, false, false);
    clientSession.createQueue(address, qName1, null, true);
  }
예제 #22
0
  private BroadcastGroup createBroadcastGroup(BroadcastGroupConfiguration config) throws Exception {
    BroadcastGroup group = broadcastGroups.get(config.getName());

    if (group == null) {
      group =
          new BroadcastGroupImpl(
              nodeManager,
              config.getName(),
              config.getBroadcastPeriod(),
              scheduledExecutor,
              config.getEndpointFactoryConfiguration().createBroadcastEndpointFactory());

      for (String connectorInfo : config.getConnectorInfos()) {
        TransportConfiguration connector =
            configuration.getConnectorConfigurations().get(connectorInfo);

        if (connector == null) {
          logWarnNoConnector(config.getName(), connectorInfo);

          return null;
        }

        group.addConnector(connector);
      }
    }

    if (group.size() == 0) {
      logWarnNoConnector(config.getConnectorInfos().toString(), group.getName());
      return null;
    }

    broadcastGroups.put(config.getName(), group);

    return group;
  }
예제 #23
0
 private void configurePaging() {
   AddressSettings addressSettings = new AddressSettings();
   addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
   addressSettings.setMaxSizeBytes(30 * 1024 * 1024);
   addressSettings.setPageSizeBytes(10 * 1024 * 1024);
   addressSettings.setPageCacheMaxSize(20);
   config.getAddressesSettings().put("jms.queue.*", addressSettings);
 }
 @Override
 /*
  * for this test the 2 live connect to each other
  * */
 public void createLiveClusterConfiguration(int server, Configuration configuration, int servers) {
   TransportConfiguration livetc = getConnectorTransportConfiguration(true, server);
   configuration.getConnectorConfigurations().put(livetc.getName(), livetc);
   List<String> connectors = new ArrayList<String>();
   for (int i = 0; i < servers; i++) {
     if (i != server) {
       TransportConfiguration staticTc = getConnectorTransportConfiguration(true, i);
       configuration.getConnectorConfigurations().put(staticTc.getName(), staticTc);
       connectors.add(staticTc.getName());
     }
   }
   basicClusterConnectionConfig(configuration, livetc.getName(), connectors);
 }
  /** @throws Exception */
  protected void startServer() throws Exception {
    Configuration conf = createDefaultConfig(false);
    conf.getConnectorConfigurations()
        .put("invm", new TransportConfiguration(INVM_CONNECTOR_FACTORY));
    conf.setSecurityEnabled(false);
    conf.setJMXManagementEnabled(true);
    conf.getAcceptorConfigurations().add(new TransportConfiguration(INVM_ACCEPTOR_FACTORY));
    server = HornetQServers.newHornetQServer(conf, mbeanServer, true);
    server.start();

    serverManager = new JMSServerManagerImpl(server);
    serverManager.start();

    ctx = new InVMNamingContext();

    serverManager.setContext(ctx);
    serverManager.activated();
  }
예제 #26
0
 static void addConnectorServiceConfigs(final Configuration configuration, final ModelNode model)
     throws OperationFailedException {
   if (model.hasDefined(CommonAttributes.CONNECTOR_SERVICE)) {
     final List<ConnectorServiceConfiguration> configs =
         configuration.getConnectorServiceConfigurations();
     for (Property prop : model.get(CommonAttributes.CONNECTOR_SERVICE).asPropertyList()) {
       configs.add(createConnectorServiceConfiguration(prop.getName(), prop.getValue()));
     }
   }
 }
예제 #27
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    Configuration conf = createDefaultConfig();
    conf.setSecurityEnabled(false);
    conf.getAcceptorConfigurations().add(new TransportConfiguration(INVM_ACCEPTOR_FACTORY));
    server = createServer(false, conf);
    jmsServer = new JMSServerManagerImpl(server);
    jmsServer.setContext(new NullInitialContext());
    jmsServer.start();

    cf1 =
        HornetQJMSClient.createConnectionFactoryWithoutHA(
            JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
    cf2 =
        HornetQJMSClient.createConnectionFactoryWithoutHA(
            JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
  }
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    Map<String, Object> params = new HashMap<String, Object>();
    // params.put(RandomUtil.randomString(), RandomUtil.randomBoolean());
    connectorConfig =
        new TransportConfiguration(
            InVMConnectorFactory.class.getName(), params, RandomUtil.randomString());

    conf = createDefaultConfig(false);
    conf.setSecurityEnabled(false);
    conf.setJMXManagementEnabled(true);
    conf.getAcceptorConfigurations().clear();
    conf.getAcceptorConfigurations()
        .add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
    server = HornetQServers.newHornetQServer(conf, mbeanServer, true);
    conf.getConnectorConfigurations().put(connectorConfig.getName(), connectorConfig);
    server.start();
  }
예제 #29
0
  @Override
  @Before
  public void setUp() throws Exception {
    super.setUp();

    Configuration config = createDefaultConfig(false);

    config.setMessageExpiryScanPeriod(10);

    HornetQSecurityManager securityManager = new HornetQSecurityManagerImpl();

    config.setPersistenceEnabled(true);

    server =
        new MyHornetQServer(config, ManagementFactory.getPlatformMBeanServer(), securityManager);

    server.start();

    locator = createInVMNonHALocator();
  }
예제 #30
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    config = createBasicConfig();
    config
        .getConnectorConfigurations()
        .put("netty", new TransportConfiguration(NettyConnectorFactory.class.getName()));

    DiscoveryGroupConfiguration dcg =
        new DiscoveryGroupConfiguration("mygroup", "172.16.8.10", "243.7.7.7", 12345, 5432, 5432);
    config.getDiscoveryGroupConfigurations().put("mygroup", dcg);
    HornetQServer server = createServer(false, config);

    deploymentManager = new FileDeploymentManager(config.getFileDeployerScanPeriod());

    jmsServer = new JMSServerManagerImpl(server);
    context = new InVMContext();
    jmsServer.setContext(context);
    jmsServer.start();
  }