Package net.timewalker.ffmq3.local.destination

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


    public QueueBrowser createBrowser(IntegerID browserId,Queue queueRef, String messageSelector) throws JMSException
    {
      synchronized (externalAccessLock)
    {
          checkNotClosed();
          LocalQueue localQueue = engine.getLocalQueue(queueRef.getQueueName());
 
          // Check temporary destinations scope (JMS Spec 4.4.3 p2)
          checkTemporaryDestinationScope(localQueue);
         
          LocalQueueBrowser browser = new LocalQueueBrowser(this,localQueue,messageSelector,browserId);
View Full Code Here


                  break;
              Thread.sleep(100);
          }
         
          // When in non-transacted mode, the ack is sent _after_ message processing so we need to wait a bit
          LocalTopic localTopic = engine.getLocalTopic(params.destinationName);
          if (!params.receiverTransacted)
          {
              while (localTopic.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();
         
          int topicSize = localTopic.getSize();
          if (topicSize > 0)
          {
              System.out.println("Expected : "+totalExpected);
              System.out.println("Received : "+totalReceived);
              System.out.println(localTopic);
              System.out.println(localTopic.getConsumersSummary());              
              TestUtils.dumpThreads();
              TestUtils.hang();
          }
         
          // Close receivers
View Full Code Here

                break;
            Thread.sleep(100);
        }

        // When in non-transacted mode, the ack is sent _after_ message processing so we need to wait a bit
        LocalTopic localTopic = engine.getLocalTopic(params.destinationName);
        if (!params.receiverTransacted)
        {
          while (localTopic.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();

        int topicSize = localTopic.getSize();
        if (topicSize > 0)
        {
            System.out.println("Expected : "+totalExpected);
            System.out.println("Received : "+totalReceived);
            System.out.println(localTopic);
            System.out.println(localTopic.getConsumersSummary());              
            TestUtils.dumpThreads();
            TestUtils.hang();
        }
       
        // Close receivers
View Full Code Here

                break;
            Thread.sleep(100);
        }

        // When in non-transacted mode, the ack is sent _after_ message processing so we need to wait a bit
        LocalTopic localTopic = engine.getLocalTopic(params.destinationName);
        if (!params.receiverTransacted)
        {
            while (localTopic.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();

        int topicSize = localTopic.getSize();
        if (topicSize > 0)
        {
            System.out.println("Expected : "+totalExpected);
            System.out.println("Received : "+totalReceived);
            System.out.println(localTopic);
            System.out.println(localTopic.getConsumersSummary());              
            TestUtils.dumpThreads();
            TestUtils.hang();
        }

        // Close receivers
View Full Code Here

                break;
            Thread.sleep(100);
        }

        // When in non-transacted mode, the ack is sent _after_ message processing so we need to wait a bit
        LocalTopic localTopic = engine.getLocalTopic(params.destinationName);
        if (!params.receiverTransacted)
        {
          while (localTopic.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();

        int topicSize = localTopic.getSize();
        if (topicSize > 0)
        {
            System.out.println("Expected : "+totalExpected);
            System.out.println("Received : "+totalReceived);
            System.out.println(localTopic);
            System.out.println(localTopic.getConsumersSummary());              
            TestUtils.dumpThreads();
            TestUtils.hang();
        }

        // Close receivers
View Full Code Here

    }
   
    private CreateConsumerResponse processCreateDurableSubscriber( CreateDurableSubscriberQuery query ) throws JMSException
    {
        LocalSession session = lookupSession(query);
        LocalDurableTopicSubscriber subscriber = (LocalDurableTopicSubscriber)session.createDurableSubscriber(query.getConsumerId(),
                                                                                                          query.getTopic(),
                                                                                                              query.getName(),
                                                                                                              query.getMessageSelector(),
                                                                                                              query.isNoLocal());
       
        // Start prefetching
        subscriber.prefetchMore();
       
        CreateConsumerResponse response = new CreateConsumerResponse();
        response.setPrefetchSize(subscriber.getPrefetchSize());
       
        return response;
    }
View Full Code Here

    }
   
    private LocalMessageConsumer lookupConsumer( AbstractConsumerQuery query ) throws JMSException
    {
        LocalSession localSession = lookupSession(query);
        LocalMessageConsumer consumer = (LocalMessageConsumer)localSession.lookupRegisteredConsumer(query.getConsumerId());
        if (consumer == null)
            throw new FFMQException("Invalid consumer id : "+query.getConsumerId(),"NETWORK_ERROR");
        return consumer;
    }
View Full Code Here

        return new RollbackResponse();
    }
   
    private GetResponse processGet( GetQuery query ) throws JMSException
    {
        LocalMessageConsumer consumer = lookupConsumer(query);
        Message msg = consumer.receiveFromDestination(0,false);    
        GetResponse response = new GetResponse();
        response.setMessage((AbstractMessage)msg);
       
        return response;
    }
View Full Code Here

        return response;
    }
   
    private AbstractResponsePacket processPrefetch( PrefetchQuery query ) throws JMSException
    {
        LocalMessageConsumer consumer = lookupConsumer(query);
        consumer.prefetchMore();

        return null; // Async call
    }
View Full Code Here

        return response;
    }
   
    private CloseConsumerResponse processCloseConsumer( CloseConsumerQuery query ) throws JMSException
    {
        LocalMessageConsumer consumer = lookupConsumer(query);
        consumer.close();
       
        // Rollback undelivered prefetched messages
        List undeliveredMessageIDs = query.getUndeliveredMessageIDs();
        if (undeliveredMessageIDs != null && !undeliveredMessageIDs.isEmpty())
          ((LocalSession)consumer.getSession()).rollbackUndelivered(undeliveredMessageIDs);

        return new CloseConsumerResponse();
    }
View Full Code Here

TOP

Related Classes of net.timewalker.ffmq3.local.destination.LocalQueue

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.