Package org.hornetq.jms.server.impl

Examples of org.hornetq.jms.server.impl.JMSServerManagerImpl


      conf.getAcceptorConfigurations()
          .add(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory"));
      server = HornetQServers.newHornetQServer(conf, mbeanServer, false);
      server.start();

      serverManager = new JMSServerManagerImpl(server);
      serverManager.start();
      serverManager.setContext(new InVMContext());
      serverManager.activated();

      clientID = RandomUtil.randomString();
View Full Code Here


      Configuration conf = createDefaultConfig();
      conf.setSecurityEnabled(false);
      conf.getAcceptorConfigurations()
          .add(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory"));
      server = HornetQServers.newHornetQServer(conf, false);
      jmsServer = new JMSServerManagerImpl(server);
      jmsServer.setContext(new NullInitialContext());
      jmsServer.start();

      cf1 = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"));
View Full Code Here

      conf.getConnectorConfigurations().put("netty", new TransportConfiguration(NettyConnectorFactory.class.getName()));
      conf.getConnectorConfigurations().put("invm", new TransportConfiguration(INVM_CONNECTOR_FACTORY));

      server = HornetQServers.newHornetQServer(conf, mbeanServer, true);

      serverManager = new JMSServerManagerImpl(server);
      context = new InVMContext();
      serverManager.setContext(context);
      serverManager.start();
      serverManager.activated();
     
View Full Code Here

      conf.getAcceptorConfigurations().add(new TransportConfiguration(acceptorFactory));
      server = HornetQServers.newHornetQServer(conf, mbeanServer, true);
      server.start();

      context = new InVMContext();
      serverManager = new JMSServerManagerImpl(server);
      serverManager.setContext(context);
      serverManager.start();
      serverManager.activated();
   }
View Full Code Here

      Configuration conf = createDefaultConfig();
      conf.setSecurityEnabled(false);
      conf.getAcceptorConfigurations()
          .add(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory"));
      server = HornetQServers.newHornetQServer(conf, false);
      jmsServer = new JMSServerManagerImpl(server);
      jmsServer.setContext(new NullInitialContext());
      jmsServer.start();

      cf1 = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"));
View Full Code Here

      backupConf.setJournalDirectory(getJournalDir(0, true));
      backupConf.setPagingDirectory(getPageDir(0, true));
      backupConf.setLargeMessagesDirectory(getLargeMessagesDir(0, true));
      backupService = HornetQServers.newHornetQServer(backupConf, true);
     
      backupJMSService = new JMSServerManagerImpl(backupService);
     
      backupJMSService.setContext(ctx2);

      backupJMSService.start();
     


      liveConf = createBasicConfig();
      liveConf.setSecurityEnabled(false);
      liveConf.setJournalType(getDefaultJournalType());
     
      liveConf.getConnectorConfigurations().put("toBackup", new TransportConfiguration(INVM_CONNECTOR_FACTORY, backupParams));
      //liveConf.setBackupConnectorName("toBackup");

      liveConf.getAcceptorConfigurations()
              .add(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory"));
      liveConf.setSharedStore(false);
      liveConf.setBindingsDirectory(getBindingsDir(0, false));
      liveConf.setJournalMinFiles(2);
      liveConf.setJournalDirectory(getJournalDir(0, false));
      liveConf.setPagingDirectory(getPageDir(0, false));
      liveConf.setLargeMessagesDirectory(getLargeMessagesDir(0, false));

      liveService = HornetQServers.newHornetQServer(liveConf, true);
     
      liveJMSService = new JMSServerManagerImpl(liveService);
     
      liveJMSService.setContext(ctx1);

      liveJMSService.start();
View Full Code Here

      TopicConfiguration topicConfig = new TopicConfigurationImpl(RandomUtil.randomString(),
                                                                  "/topic/binding1",
                                                                  "/topic/binding2");
      jmsConfiguration.getTopicConfigurations().add(topicConfig);

      JMSServerManager server = new JMSServerManagerImpl(coreServer, jmsConfiguration);
      server.start();

      for (String binding : cfConfig.getBindings())
      {
         Object o = context.lookup(binding);
         Assert.assertNotNull(o);
         Assert.assertTrue(o instanceof ConnectionFactory);
         ConnectionFactory cf = (ConnectionFactory)o;
         Connection connection = cf.createConnection();
         connection.close();
      }

      for (String binding : queueConfig.getBindings())
      {
         Object o = context.lookup(binding);
         Assert.assertNotNull(o);
         Assert.assertTrue(o instanceof Queue);
         Queue queue = (Queue)o;
         Assert.assertEquals(queueConfig.getName(), queue.getQueueName());
      }

      for (String binding : topicConfig.getBindings())
      {
         Object o = context.lookup(binding);
         Assert.assertNotNull(o);
         Assert.assertTrue(o instanceof Topic);
         Topic topic = (Topic)o;
         Assert.assertEquals(topicConfig.getName(), topic.getTopicName());
      }

      server.stop();
   }
View Full Code Here

         final HornetQServer server = HornetQServers.newHornetQServer(conf, false);

         Hashtable<String, String> env = new Hashtable<String, String>();
         env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
         env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
         JMSServerManager serverManager = new JMSServerManagerImpl(server);
         serverManager.setContext(new InitialContext(env));
         serverManager.start();

         System.out.println("Server started, ready to start client test");

         // create the reader before printing OK so that if the test is quick
         // we will still capture the STOP message sent by the client
View Full Code Here

      backupConf.setLargeMessagesDirectory(getLargeMessagesDir());
      backupConf.setPersistenceEnabled(true);
      backupConf.setClustered(true);
      backupService = new InVMNodeManagerServer(backupConf, nodeManager);

      backupJMSService = new JMSServerManagerImpl(backupService);

      backupJMSService.setContext(ctx2);

      backupJMSService.getHornetQServer().setIdentity("JMSBackup");
      log.info("Starting backup");
      backupJMSService.start();

      liveConf = createBasicConfig(0);

      liveConf.setJournalDirectory(getJournalDir());
      liveConf.setBindingsDirectory(getBindingsDir());

      liveConf.setSecurityEnabled(false);
      liveConf.getAcceptorConfigurations().add(liveAcceptortc);
      List<String> pairs = null;
      ClusterConnectionConfiguration ccc0 = new ClusterConnectionConfiguration("cluster1",
                                                                               "jms",
                                                                               livetc.getName(),
                                                                               -1,
                                                                               false,
                                                                               false,
                                                                               1,
                                                                               1,
                                                                               pairs,
                                                                               false);
      liveConf.getClusterConfigurations().add(ccc0);
      liveConf.setSharedStore(true);
      liveConf.setJournalType(getDefaultJournalType());
      liveConf.setBindingsDirectory(getBindingsDir());
      liveConf.setJournalMinFiles(2);
      liveConf.setJournalDirectory(getJournalDir());
      liveConf.setPagingDirectory(getPageDir());
      liveConf.setLargeMessagesDirectory(getLargeMessagesDir());
      liveConf.getConnectorConfigurations().put(livetc.getName(), livetc);
      liveConf.setPersistenceEnabled(true);
      liveConf.setClustered(true);
      liveService = new InVMNodeManagerServer(liveConf, nodeManager);

      liveJMSService = new JMSServerManagerImpl(liveService);

      liveJMSService.setContext(ctx1);

      liveJMSService.getHornetQServer().setIdentity("JMSLive");
      log.info("Starting life");
View Full Code Here

      config.setJournalSyncNonTransactional(false);

      HornetQServer server = createServer(true, config, PAGE_SIZE, -1, new HashMap<String, AddressSettings>());

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

      jmsServer.createTopic(true, "tt", "/topic/TT");

      server.getHornetQServerControl().addAddressSettings("jms.topic.TT",
                                                          "DLQ",
                                                          "DLQ",
                                                          false,
                                                          5,
                                                          1024 * 1024,
                                                          1024 * 10,
                                                          5,
                                                          5,
                                                          0,
                                                          false,
                                                          "PAGE");

      HornetQJMSConnectionFactory cf = (HornetQJMSConnectionFactory)HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
                                                                                                                      new TransportConfiguration(INVM_CONNECTOR_FACTORY));

      Connection conn = cf.createConnection();
      conn.setClientID("tst");
      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      Topic topic = (Topic)context.lookup("/topic/TT");
      sess.createDurableSubscriber(topic, "t1");
     
      MessageProducer prod = sess.createProducer(topic);
      prod.setDeliveryMode(DeliveryMode.PERSISTENT);
      TextMessage txt = sess.createTextMessage("TST");
      prod.send(txt);
     
      PagingStore store = server.getPagingManager().getPageStore(new SimpleString("jms.topic.TT"));

      assertEquals(1024 * 1024, store.getMaxSize());
      assertEquals(10 * 1024, store.getPageSizeBytes());

      jmsServer.stop();

      server = createServer(true, config, PAGE_SIZE, -1, new HashMap<String, AddressSettings>());

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

      AddressSettings settings = server.getAddressSettingsRepository().getMatch("jms.topic.TT");

      assertEquals(1024 * 1024, settings.getMaxSizeBytes());
      assertEquals(10 * 1024, settings.getPageSizeBytes());
      assertEquals(AddressFullMessagePolicy.PAGE, settings.getAddressFullMessagePolicy());

      store = server.getPagingManager().getPageStore(new SimpleString("TT"));
     
      conn.close();

      server.stop();
     
      jmsServer.stop();

   }
View Full Code Here

TOP

Related Classes of org.hornetq.jms.server.impl.JMSServerManagerImpl

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.