Package org.hornetq.jms.server.config

Examples of org.hornetq.jms.server.config.JMSConfiguration


    */
   protected JMSConfiguration newConfig(final ArrayList<JMSQueueConfiguration> queues,
                                        final ArrayList<TopicConfiguration> topics,
                                        final ArrayList<ConnectionFactoryConfiguration> cfs, String domain)
   {
      JMSConfiguration value = new JMSConfigurationImpl(cfs, queues, topics, domain);
      return value;
   }
View Full Code Here


      TransportConfiguration stompTransport = new TransportConfiguration(NettyAcceptorFactory.class.getName(), params);
      config.getAcceptorConfigurations().add(stompTransport);
      config.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
      HornetQServer hornetQServer = HornetQServers.newHornetQServer(config);

      JMSConfiguration jmsConfig = new JMSConfigurationImpl();
      jmsConfig.getQueueConfigurations()
               .add(new JMSQueueConfigurationImpl(getQueueName(), null, false, getQueueName()));
      jmsConfig.getTopicConfigurations().add(new TopicConfigurationImpl(getTopicName(), getTopicName()));
      server = new JMSServerManagerImpl(hornetQServer, jmsConfig);
      server.setContext(new InVMContext());
      return server;
   }
View Full Code Here

      Context context = new InVMContext();

      Configuration coreConfiguration = createDefaultConfig(false);
      HornetQServer coreServer = new HornetQServerImpl(coreConfiguration);

      JMSConfiguration jmsConfiguration = new JMSConfigurationImpl();
      jmsConfiguration.setContext(context);
      TransportConfiguration connectorConfig = new TransportConfiguration(InVMConnectorFactory.class.getName());
      ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl(RandomUtil.randomString(),
                                                                                       connectorConfig,
                                                                                       "/cf/binding1",
                                                                                       "/cf/binding2");
      jmsConfiguration.getConnectionFactoryConfigurations().add(cfConfig);
      JMSQueueConfigurationImpl queueConfig = new JMSQueueConfigurationImpl(RandomUtil.randomString(),
                                                                      null,
                                                                      false,
                                                                      "/queue/binding1",
                                                                      "/queue/binding2");
      jmsConfiguration.getQueueConfigurations().add(queueConfig);
      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())
View Full Code Here

      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("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(false, cfConfig.isFailoverOnServerShutdown());
      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]);
     
View Full Code Here

      config.getAcceptorConfigurations().add(stompTransport);
      config.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
      config.getQueueConfigurations().add(new CoreQueueConfiguration(getQueueName(), getQueueName(), null, false));
       HornetQServer hornetQServer = HornetQServers.newHornetQServer(config);
      
       JMSConfiguration jmsConfig = new JMSConfigurationImpl();
       server = new JMSServerManagerImpl(hornetQServer, jmsConfig);
       server.setContext(null);
       return server;
   }
View Full Code Here

      TransportConfiguration stompTransport = new TransportConfiguration(NettyAcceptorFactory.class.getName(), params);
      config.getAcceptorConfigurations().add(stompTransport);
      config.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
      HornetQServer hornetQServer = HornetQServers.newHornetQServer(config);

      JMSConfiguration jmsConfig = new JMSConfigurationImpl();
      jmsConfig.getQueueConfigurations()
               .add(new JMSQueueConfigurationImpl(getQueueName(), null, false, getQueueName()));
      jmsConfig.getTopicConfigurations().add(new TopicConfigurationImpl(getTopicName(), getTopicName()));
      server = new JMSServerManagerImpl(hornetQServer, jmsConfig);
      server.setContext(new InVMContext());
      return server;
   }
View Full Code Here

               queues.add(parseQueueConfiguration(node));
            }
         }
      }

      JMSConfiguration value = newConfig(queues, topics, cfs);

      return value;
   }
View Full Code Here

    */
   protected JMSConfiguration newConfig(final ArrayList<JMSQueueConfiguration> queues,
                                        final ArrayList<TopicConfiguration> topics,
                                        final ArrayList<ConnectionFactoryConfiguration> cfs)
   {
      JMSConfiguration value = new JMSConfigurationImpl(cfs, queues, topics);
      return value;
   }
View Full Code Here

         configuration.getConnectorConfigurations().put("connector", connectorConfig);


         // Step 2. Create the JMS configuration
         JMSConfiguration jmsConfig = new JMSConfigurationImpl();

         // Step 3. Configure the JMS ConnectionFactory
         ArrayList<String> connectorNames = new ArrayList<String>();
         connectorNames.add("connector");
         ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl("cf", false,  connectorNames, "/cf");
         jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);

         // Step 4. Configure the JMS Queue
         JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl("queue1", null, false, "/queue/queue1");
         jmsConfig.getQueueConfigurations().add(queueConfig);

         // Step 5. Start the JMS Server using the HornetQ core server and the JMS configuration
         EmbeddedJMS jmsServer = new EmbeddedJMS();
         jmsServer.setConfiguration(configuration);
         jmsServer.setJmsConfiguration(jmsConfig);
View Full Code Here

      conf.setSecurityEnabled(false);
      conf.setJMXManagementEnabled(true);
      conf.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
      HornetQServer server = HornetQServers.newHornetQServer(conf, false);

      JMSConfiguration configuration = new JMSConfigurationImpl();
      context = new InVMContext();
      configuration.setContext(context);
      configuration.getQueueConfigurations().add(new JMSQueueConfigurationImpl(queueName, null, true, queueName));

      ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl("cf",
                                                                                       new TransportConfiguration(NettyConnectorFactory.class.getName()),
                                                                                       "/cf");
      cfConfig.setRetryInterval(1000);
      cfConfig.setRetryIntervalMultiplier(1.0);
      cfConfig.setReconnectAttempts(-1);
      cfConfig.setFailoverOnServerShutdown(true);
      configuration.getConnectionFactoryConfigurations().add(cfConfig);
      serverManager = new JMSServerManagerImpl(server, configuration);
      serverManager.start();

      listener = new Listener();
View Full Code Here

TOP

Related Classes of org.hornetq.jms.server.config.JMSConfiguration

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.