Examples of LocalQueue


Examples of net.timewalker.ffmq3.local.destination.LocalQueue

            System.out.println("Received : "+totalReceived);
            fail("Some messages were not received !");
          }
 
          // Check for remaining messages
          LocalQueue localQueue = engine.getLocalQueue(params.destinationName);
          assertEquals(0,localQueue.getSize());
      }
      catch (Exception e)
      {
        if (connection != null)
          connection.close();
View Full Code Here

Examples of net.timewalker.ffmq3.local.destination.LocalQueue

                  break;
              Thread.sleep(100);
          }
         
          // When in non-transacted mode, the ack is sent _after_ message processing so we need to wait a bit
          LocalQueue localQueue = engine.getLocalQueue(params.destinationName);
          if (!params.receiverTransacted)
          {
            while (localQueue.getSize() > 0)
              Thread.sleep(10);
          }
         
          long endTime = System.currentTimeMillis();
          double rate = (double)totalExpected*1000/(endTime-startTime);
          System.out.println((endTime-startTime)+" ms ("+rateFormat.format(rate)+" msg/s)");

          int totalReceived = 0;
          for (int n = 0 ; n < receivers.length ; n++)
              totalReceived += receivers[n].getReceivedCount();
 
          // Close receivers
          for (int n = 0 ; n < receivers.length ; n++)
              receivers[n].close();
          for (int n = 0 ; n < receivers.length ; n++)
              terminateThread(receivers[n]);

          // Close connection
          listenerConnection.close();
          producerConnection.close();
         
          // Check for errors
          for (int n = 0 ; n < receivers.length ; n++)
              assertFalse(receivers[n].isInError());
          for (int n = 0 ; n < senders.length ; n++)
              assertFalse(senders[n].isInError());
         
          // Check received message count
          if (totalExpected != totalReceived)
          {
            System.out.println("Expected : "+totalExpected);
            System.out.println("Received : "+totalReceived);
            fail("Some messages were not received !");
          }
         
          // Check for remaining messages
            assertEquals(0,localQueue.getSize());
      }
      catch (Exception e)
      {
        if (listenerConnection != null)
          listenerConnection.close();
View Full Code Here

Examples of net.timewalker.ffmq3.local.destination.LocalQueue

            System.out.println("Received : "+totalReceived);
            fail("Some messages were not received !");
          }
         
          // Check for remaining messages
            LocalQueue localQueue = engine.getLocalQueue(params.destinationName);
            assertEquals(0,localQueue.getSize());
      }
      catch (Exception e)
      {
        if (receiverConnections != null)
        {
View Full Code Here

Examples of net.timewalker.ffmq3.local.destination.LocalQueue

                  break;
              Thread.sleep(100);
          }
         
          // When in non-transacted mode, the ack is sent _after_ message processing so we need to wait a bit
          LocalQueue localQueue = engine.getLocalQueue(params.destinationName);
          if (!params.receiverTransacted)
          {
            while (localQueue.getSize() > 0)
              Thread.sleep(10);
          }
         
          long endTime = System.currentTimeMillis();
          double rate = (double)totalExpected*1000/(endTime-startTime);
          System.out.println((endTime-startTime)+" ms ("+rateFormat.format(rate)+" msg/s)");

          int totalReceived = 0;
          for (int n = 0 ; n < receivers.length ; n++)
              totalReceived += receivers[n].getReceivedCount();

          // Close receivers
          for (int n = 0 ; n < receivers.length ; n++)
              receivers[n].close();
          for (int n = 0 ; n < receivers.length ; n++)
              receivers[n].join(5*1000);

          // Close connection
          for (int n = 0 ; n < receiverConnections.length ; n++)
              receiverConnections[n].close();
          for (int n = 0 ; n < sendersConnections.length ; n++)
              sendersConnections[n].close();
         
          // Check for errors
          for (int n = 0 ; n < receivers.length ; n++)
              assertFalse(receivers[n].isInError());
          for (int n = 0 ; n < senders.length ; n++)
              assertFalse(senders[n].isInError());
         
          // Check received message count
          if (totalExpected != totalReceived)
          {
            System.out.println("Expected : "+totalExpected);
            System.out.println("Received : "+totalReceived);
            fail("Some messages were not received !");
          }
         
          // Check for remaining messages
            assertEquals(0,localQueue.getSize());
      }
      catch (Exception e)
      {
        if (receiverConnections != null)
        {
View Full Code Here

Examples of net.timewalker.ffmq3.local.destination.LocalQueue

    {
        log.info("Starting remote administration thread ...");

        try
        {
            LocalQueue inputQueue = engine.getLocalQueue(FFMQConstants.ADM_REQUEST_QUEUE);
            LocalQueue outputQueue = engine.getLocalQueue(FFMQConstants.ADM_REPLY_QUEUE);
           
            conn = new LocalQueueConnection(engine, null, null);
            session = conn.createQueueSession(true, Session.SESSION_TRANSACTED);
            receiver = session.createReceiver(inputQueue);
            sender = session.createSender(outputQueue);

            conn.start();

            // Flush input queue on startup
            inputQueue.purge(null);
            outputQueue.purge(null);
           
            // Enter listening loop
            notifyStartup();
            while (!stopRequired)
            {
View Full Code Here

Examples of net.timewalker.ffmq3.local.destination.LocalQueue

     */
    public final void checkTemporaryDestinationScope( Destination destination ) throws JMSException
    {
      if (destination instanceof LocalQueue)
      {
        LocalQueue localQueue = (LocalQueue)destination;
          if (localQueue.isTemporary() && !connection.isRegisteredTemporaryQueue(localQueue.getQueueName()))
             throw new IllegalStateException("Temporary queue does not belong to session's connection.");
      }
      else
      if (destination instanceof LocalTopic)
      { 
View Full Code Here

Examples of net.timewalker.ffmq3.local.destination.LocalQueue

            {
              List queues = new ArrayList();
              queues.addAll(queueMap.values());
              for (int i = 0; i < queues.size(); i++)
        {
                    LocalQueue localQueue = (LocalQueue)queues.get(i);
                    try
                    {
                      undeployQueue(localQueue);
                    }
                    catch (JMSException e)
View Full Code Here

Examples of net.timewalker.ffmq3.local.destination.LocalQueue

     */
    public void deleteQueue( String queueName , boolean force ) throws JMSException
    {
        synchronized (queueMap)
        {
            LocalQueue queue = (LocalQueue)queueMap.get(queueName);
            if (queue != null)
            {
                undeployQueue(queue);
                log.debug("Undeployed local queue : "+queueName);
            }
View Full Code Here

Examples of net.timewalker.ffmq3.local.destination.LocalQueue

     */
    public LocalQueue getLocalQueue( String queueName ) throws JMSException
    {
        synchronized (queueMap)
        {
            LocalQueue queue = (LocalQueue)queueMap.get(queueName);
            if (queue == null)
                return loadOrAutoCreateQueue(queueName);
           
            return queue;
        }
View Full Code Here

Examples of net.timewalker.ffmq3.local.destination.LocalQueue

     */
    public boolean localQueueExists( String queueName ) throws JMSException
    {
        synchronized (queueMap)
        {
            LocalQueue queue = (LocalQueue)queueMap.get(queueName);
            if (queue != null)
                return true;
               
            // Check if a definition exists
            if (destinationDefinitionProvider.getQueueDefinition(queueName) != null)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.