Examples of TopicBrowser


Examples of com.taobao.metamorphosis.client.TopicBrowser

public class TopicBrowserExample {
    public static void main(final String[] args) throws Exception {
        // New session factory,ǿ�ҽ���ʹ�õ���
        final MessageSessionFactory sessionFactory = new MetaMessageSessionFactory(initMetaConfig());
        final String topic = "meta-test";
        final TopicBrowser browser = sessionFactory.createTopicBrowser(topic);

        Iterator<Message> it = browser.iterator();
        while (it.hasNext()) {
            Message msg = it.next();
            System.out.println("message body:" + new String(msg.getData()));
        }

        browser.shutdown();
        sessionFactory.shutdown();
    }
View Full Code Here

Examples of com.taobao.metamorphosis.client.TopicBrowser

        finally {
            this.producer.shutdown();
            this.consumer.shutdown();
        }

        TopicBrowser topicBrowser = this.sessionFactory.createTopicBrowser(this.topic);
        try {
            Iterator<Message> it = topicBrowser.iterator();
            int n = 0;
            while (it.hasNext()) {
                assertNotNull(it.next());
                n++;
            }
            assertEquals(100, n);
        }
        finally {
            topicBrowser.shutdown();
        }
    }
View Full Code Here

Examples of hermes.impl.TopicBrowser

  public MessageRenderer getMessageRenderer() throws JMSException {
    return null;
  }

  public QueueBrowser createDurableSubscriptionBrowser(DestinationConfig dConfig) throws JMSException {
    return new TopicBrowser(getHermes().getSession(), getHermes().getDestinationManager(), dConfig);
  }
View Full Code Here

Examples of hermes.impl.TopicBrowser

        return ((QueueSession) getSession()).createBrowser(queue, config.getSelector());
      } else {
        return ((QueueSession) getSession()).createBrowser(queue);
      }
    } else if (config.getDomain() == Domain.TOPIC.getId()) {
      return new TopicBrowser(hermes.getSession(), destinationManager, config);
    } else {
      throw new HermesException("The domain for " + config.getName() + " is not defined, configure it as a queue or a topic");
    }

  }
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.