Package net.timewalker.ffmq3.common.message

Examples of net.timewalker.ffmq3.common.message.AbstractMessage


                  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

   * @see net.timewalker.ffmq3.utils.Checkable#check()
   */
  public void check() throws JMSException
    {
      if (StringTools.isEmpty(name))
          throw new InvalidDescriptorException("Missing user name in security descriptor");
      if (password == null)
          throw new InvalidDescriptorException("Missing password definition for user "+name);
    }
View Full Code Here

            // Check temporary destinations scope (JMS Spec 4.4.3 p2)
            session.checkTemporaryDestinationScope(localTopic);
           
            // Deploy a local queue for this consumer
            TopicDefinition topicDef = this.localTopic.getDefinition();
            QueueDefinition tempDef = topicDef.createQueueDefinition(topicRef.getTopicName(), subscriberId, !isDurable());           
            if (engine.localQueueExists(tempDef.getName()))
                this.localQueue = engine.getLocalQueue(tempDef.getName());
            else
                this.localQueue = engine.createQueue(tempDef);
           
            // Register on both the queue and topic
            this.localQueue.registerConsumer(this);
View Full Code Here

           
            // Check temporary destinations scope (JMS Spec 4.4.3 p2)
            session.checkTemporaryDestinationScope(localTopic);
           
            // Deploy a local queue for this consumer
            TopicDefinition topicDef = this.localTopic.getDefinition();
            QueueDefinition tempDef = topicDef.createQueueDefinition(topicRef.getTopicName(), subscriberId, !isDurable());           
            if (engine.localQueueExists(tempDef.getName()))
                this.localQueue = engine.getLocalQueue(tempDef.getName());
            else
                this.localQueue = engine.createQueue(tempDef);
           
View Full Code Here

   */
  public void checkPermission(String resourceName, String action) throws JMSException
  {
    for (int i = 0; i < privileges.size(); i++)
    {
      Privilege privilege = (Privilege)privileges.get(i);
      if (privilege.matches(resourceName, action))
        return;
    }
    throw new FFMQException("Access denied to resource '"+resourceName+"' for action '"+action+"'","ACCESS_DENIED");
  }
View Full Code Here

TOP

Related Classes of net.timewalker.ffmq3.common.message.AbstractMessage

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.