Package org.hornetq.api.core

Examples of org.hornetq.api.core.TransportConfiguration


        configuration.setPersistenceEnabled(false);
        configuration.setSecurityEnabled(false);
        configuration.setClustered(false);
      }

      TransportConfiguration transpConf = new TransportConfiguration(NettyAcceptorFactory.class.getName(), connectionParams);

      HashSet<TransportConfiguration> setTransp = new HashSet<TransportConfiguration>();
      setTransp.add(transpConf);

      configuration.setAcceptorConfigurations(setTransp);

      server = HornetQServers.newHornetQServer(configuration);
      server.start();
      embeddedServerRunning = true;
    }

    TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getCanonicalName(), connectionParams);
    ClientSessionFactory factory = HornetQClient.createClientSessionFactory(transportConfiguration);
    session = factory.createSession();
    try {
      session.createQueue(SERVER_TASK_COMMANDS_QUEUE, SERVER_TASK_COMMANDS_QUEUE, true);
    }
View Full Code Here


        port = 5445;
      }
      connectionParams.put(TransportConstants.PORT_PROP_NAME, port);
      connectionParams.put(TransportConstants.HOST_PROP_NAME, address);

      TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getCanonicalName(), connectionParams);
      ClientSessionFactory factory = HornetQClient.createClientSessionFactory(transportConfiguration);
      session = factory.createSession();
      producer = session.createProducer(HornetQTaskServer.SERVER_TASK_COMMANDS_QUEUE);

      createClientQueue();
View Full Code Here

      StringBuffer backupTransportParams = new StringBuffer();
      for (Pair<TransportConfiguration, TransportConfiguration> pair : pairs)
      {
         if (pair.a != null)
         {
            TransportConfiguration live = pair.a;
            if(liveTransportClassNames.length() > 0)
            {
               liveTransportClassNames.append(",");
            }
            liveTransportClassNames.append(live.getFactoryClassName());

            Map<String, Object> params = live.getParams();
            liveTransportParams.append("{");
            for (Map.Entry<String, Object> stringObjectEntry : params.entrySet())
            {
               if(liveTransportParams.length() > 1)
               {
                  liveTransportParams.append(",");
               }
               liveTransportParams.append(stringObjectEntry.getKey()).append("=").append(stringObjectEntry.getValue());
            }
            liveTransportParams.append("}");
         }

         if (pair.b != null)
         {
            TransportConfiguration backUp = pair.b;
            if(backupTransportClassNames.length() > 0)
            {
               backupTransportClassNames.append(",");
            }
            backupTransportClassNames.append(backUp.getFactoryClassName());

            Map<String, Object> params = backUp.getParams();
            backupTransportParams.append("{");
            for (Map.Entry<String, Object> stringObjectEntry : params.entrySet())
            {
               if(backupTransportParams.length() > 1)
               {
View Full Code Here

    static ClientSessionFactory createClientSessionFactory(String host, int port) {
        final Map<String, Object> properties = new HashMap<String, Object>();
        properties.put("host", host);
        properties.put("port", port);
        final TransportConfiguration configuration = new TransportConfiguration(NettyConnectorFactory.class.getName(), properties);
        return HornetQClient.createClientSessionFactory(configuration);
    }
View Full Code Here

        try {
            //HornetQService set up the config and starts the HornetQServer

            //Not using JNDI so we use the core services directly
            sf = HornetQClient.createClientSessionFactory(new TransportConfiguration(InVMConnectorFactory.class.getName()));

            //Create a queue
            ClientSession coreSession = sf.createSession(false, true, true);
            coreSession.createQueue(QUEUE_EXAMPLE_QUEUE, QUEUE_EXAMPLE_QUEUE, true);
            coreSession.close();
View Full Code Here

      super.setUp();

      Configuration conf = createBasicConfig();
      conf.setSecurityEnabled(false);
      conf.setJMXManagementEnabled(true);
      conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
      server = HornetQServers.newHornetQServer(conf, mbeanServer, false);
      server.start();

      locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
      locator.setBlockOnNonDurableSend(true);
      locator.setBlockOnNonDurableSend(true);
      locator.setConsumerWindowSize(0);
      ClientSessionFactory sf = locator.createSessionFactory();
      session = sf.createSession(false, true, false);
View Full Code Here

      addressSettings.clear();
      configuration = createBasicConfig();
      configuration.setSecurityEnabled(false);
      configuration.setTransactionTimeoutScanPeriod(500);
      TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
      configuration.getAcceptorConfigurations().add(transportConfig);
      messagingService = HornetQServers.newHornetQServer(configuration, false);
      // start the server
      messagingService.start();
      // then we create a client as normal
      ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getName()));
      sessionFactory = locator.createSessionFactory();
      clientSession = sessionFactory.createSession(true, false, false);
      clientSession.createQueue(atestq, atestq, null, true);
      clientProducer = clientSession.createProducer(atestq);
      clientConsumer = clientSession.createConsumer(atestq);
View Full Code Here

         }
        
      }
      messagingService.getRemotingService().addInterceptor(new SomeInterceptor());
     
      ServerLocator locatorTimeout = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getName()));
      locatorTimeout.setCallTimeout(300);
      ClientSessionFactory factoryTimeout = locatorTimeout.createSessionFactory();

      final ClientSession sessionTimeout  = factoryTimeout.createSession(true, false, false);
     
View Full Code Here

               DiscoveryEntry[] entriesRead = new DiscoveryEntry[size];
               // Will first decode all the elements outside of any lock
               for (int i = 0; i < size; i++)
               {
                  TransportConfiguration connector = new TransportConfiguration();

                  connector.decode(buffer);

                  entriesRead[i] = new DiscoveryEntry(originatingNodeID, connector, System.currentTimeMillis());
               }

               synchronized (DiscoveryGroup.this)
View Full Code Here

   @Override
   protected void setUp() throws Exception
   {
      super.setUp();

      locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY));
      ClientSessionFactory sf = locator.createSessionFactory();
      session = sf.createSession(false, true, true);
      session.start();
   }
View Full Code Here

TOP

Related Classes of org.hornetq.api.core.TransportConfiguration

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.