Examples of MessageSelector


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

        super(session,destination,messageSelector,noLocal,consumerId);
        this.engine = engine;
        this.session = session;
        this.parsedSelector =
            StringTools.isNotEmpty(messageSelector) ?
                new MessageSelector(messageSelector) : null;
        this.traceEnabled = log.isTraceEnabled();
        this.transactionSet = session.getTransactionSet();
        this.notificationProxy = session.getNotificationProxy();
        this.prefetchCapacity = this.prefetchSize = engine.getSetup().getConsumerPrefetchSize();
        this.logListenersFailures = getSettings().getBooleanProperty(FFMQCoreSettings.DELIVERY_LOG_LISTENERS_FAILURES, false);
View Full Code Here

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

          throw new FFMQException("Consumer should not be accessed by more than one thread","ILLEGAL_USAGE");
       
        receiving = true;
        try
        {
          MessageSelector selector = getReceiveSelector();
         
          // No-wait simplified case
          if (timeout == 0)
          {
            if (!connection.isStarted())
View Full Code Here

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

      System.out.println("-------------------------------------------------");
        for (int n = 0 ; n < VALID_SELECTORS.length; n++)
        {
            System.out.print("TESTING valid ["+VALID_SELECTORS[n]+"] : ");
           
            MessageSelector selector = new MessageSelector(VALID_SELECTORS[n].getSelector());
            System.out.println(selector);
            boolean matches = selector.matches(getTestMessage());
            assertEquals(VALID_SELECTORS[n].getSelector(),VALID_SELECTORS[n].shouldMatch(), matches);
           
            String render1 = selector.toString();
            selector = new MessageSelector(render1);
            matches = selector.matches(getTestMessage());
            assertEquals(VALID_SELECTORS[n].shouldMatch(), matches);
           
            String render2 = selector.toString();
            if (!render1.equals(render2))
              fail("["+render1+"] <> ["+render2+"]");
        }
        System.out.println("-------------------------------------------------");
    }
View Full Code Here

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

        for (int n = 0 ; n < FAIL_ON_EVAL_SELECTORS.length; n++)
        {
            System.out.print("TESTING fail on eval ["+FAIL_ON_EVAL_SELECTORS[n]+"] ");
            try
            {
                MessageSelector selector = new MessageSelector(FAIL_ON_EVAL_SELECTORS[n]);
                selector.matches(getTestMessage());
               
                fail("Should have failed : "+FAIL_ON_EVAL_SELECTORS[n]);
            }
            catch (JMSException e)
            {
View Full Code Here

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

                continue;

            try
            {
                // Message selector filtering
                MessageSelector selector = subscription.getMessageSelector();
                if (selector != null)
                {
                  srcMessage.ensureDeserializationLevel(MessageSerializationLevel.ALL_HEADERS);
                  if (!selector.matches(srcMessage))
                    continue;
                }
               
              if (subscription.getLocalQueue().put(srcMessage))
              {
View Full Code Here

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

   * Constructor
   */
  public LocalQueueBrowser( LocalSession session , LocalQueue queue , String messageSelector , IntegerID browserId ) throws JMSException
  {
    super(session,queue,messageSelector,browserId);
    this.parsedSelector = (StringTools.isNotEmpty(messageSelector) ? new MessageSelector(messageSelector) : null);
  }
View Full Code Here

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

      try
        {       
          // Check message selector
          if (message != null)
          {   
                MessageSelector consumerSelector = consumer.getReceiveSelector();
                if (consumerSelector != null)
                {
                  message.ensureDeserializationLevel(MessageSerializationLevel.ALL_HEADERS);
                  if (!consumerSelector.matches(message))
                    return;
                }
          }
 
        if (consumer.mayBlock())
View Full Code Here

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

              continue;
           
            // Check message selector
            if (message != null)
            {
              MessageSelector consumerSelector = consumer.getReceiveSelector();
              if (consumerSelector != null)
                {
                message.ensureDeserializationLevel(MessageSerializationLevel.ALL_HEADERS);
               
                  try
                  {
                      if (!consumerSelector.matches(message))
                        continue;
                  }
                  catch (JMSException e)
                  {
                    ErrorTools.log(e, log);
View Full Code Here

Examples of org.springframework.integration.core.MessageSelector

            if (!(destinationChannel instanceof MessageSelectingQueueChannel)) {
                throw new CitrusRuntimeException("Message channel type '" + endpointConfiguration.getChannel().getClass() +
                        "' does not support selective receive operations.");
            }

            MessageSelector messageSelector = new DispatchingMessageSelector(selector, endpointConfiguration.getBeanFactory());
            MessageSelectingQueueChannel queueChannel = ((MessageSelectingQueueChannel) destinationChannel);

            if (timeout <= 0) {
                message = endpointConfiguration.getMessageConverter().convertInbound(queueChannel.receive(messageSelector), endpointConfiguration);
            } else {
View Full Code Here

Examples of org.springframework.integration.core.MessageSelector

       
        channel.send(MessageBuilder.withPayload("FooMessage").setHeader("foo", "bar").build());
       
        Map<String, String> headers = new HashMap<String, String>();
        headers.put("foo", "bar");
        MessageSelector selector = new HeaderMatchingMessageSelector(headers);
       
        Message<?> receivedMessage = channel.receive(selector, 1000L);
       
        Assert.assertEquals(receivedMessage.getPayload(), "FooMessage");
        Assert.assertEquals(receivedMessage.getHeaders().get("foo"), "bar");
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.