Package com.taobao.metamorphosis.client

Examples of com.taobao.metamorphosis.client.MetaMessageSessionFactory.createProducer()


public class Producer {
    public static void main(final String[] args) throws Exception {
        // New session factory,ǿ�ҽ���ʹ�õ���
        final MessageSessionFactory sessionFactory = new MetaMessageSessionFactory(initMetaConfig());
        // create producer,ǿ�ҽ���ʹ�õ���
        final MessageProducer producer = sessionFactory.createProducer();
        // publish topic
        final String topic = "meta-test";
        producer.publish(topic);

        final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
View Full Code Here


public class AsyncProducer {
    public static void main(final String[] args) throws Exception {
        // New session factory,ǿ�ҽ���ʹ�õ���
        final MessageSessionFactory sessionFactory = new MetaMessageSessionFactory(initMetaConfig());
        // create producer,ǿ�ҽ���ʹ�õ���
        final MessageProducer producer = sessionFactory.createProducer();
        // publish topic
        final String topic = "slave-test";
        producer.publish(topic);

        final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
View Full Code Here

public class TransactionProducer {
    public static void main(final String[] args) throws Exception {
        // New session factory,ǿ�ҽ���ʹ�õ���
        final MessageSessionFactory sessionFactory = new MetaMessageSessionFactory(initMetaConfig());
        // create producer,ǿ�ҽ���ʹ�õ���
        final MessageProducer producer = sessionFactory.createProducer();
        // publish topic
        final String topic = "meta-test";
        producer.publish(topic);

        // ��������ʱΪ10��
View Full Code Here

  public static void main(String[] args) throws Exception {
    MetaClientConfig config = new MetaClientConfig();
    ZKConfig zkConfig = new ZKConfig("10.249.197.121", 30000, 30000, 5000);
    config.setZkConfig(zkConfig);
    MetaMessageSessionFactory factory = new MetaMessageSessionFactory(config);
    MessageProducer producer = factory.createProducer(false);
    String topic = "test";
    producer.publish(topic);
    Message message = new Message(topic, new byte[128]);
    producer.sendMessage(message);
   
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.