Package com.taobao.metamorphosis.client

Examples of com.taobao.metamorphosis.client.MetaClientConfig


public class SlaveMetaMessageSessionFactoryTest {

    @Test
    public void testCreate() throws Exception {
        MetaClientConfig metaClientConfig = new MetaClientConfig();
        SlaveMetaMessageSessionFactory.create(metaClientConfig, 100);
    }
View Full Code Here


*/

public class OrderedProducer {
    public static void main(final String[] args) throws Exception {

        final MetaClientConfig metaClientConfig = initMetaConfig();

        // ���÷����ֲ����,Ҫ������˶�Ӧ
        final Properties partitionsInfo = new Properties();
        partitionsInfo.put("topic.num.exampleTopic1", "0:4;1:4");
        metaClientConfig.setPartitionsInfo(partitionsInfo);

        // New session factory,ǿ�ҽ���ʹ�õ���
        final OrderedMessageSessionFactory sessionFactory = new OrderedMetaMessageSessionFactory(metaClientConfig);

        // create producer,ǿ�ҽ���ʹ�õ���
View Full Code Here


    @Override
    @Before
    public void setUp() throws Exception {
        final MetaClientConfig metaClientConfig = new MetaClientConfig();
        metaClientConfig.setRecoverMessageIntervalInMills(2000);// recoverʱ���һЩ
        this.sessionFactory = new MetaMessageSessionFactory(metaClientConfig);
        this.startServer("server1");
        System.out.println("before run");
    }
View Full Code Here

        AsyncMetaMessageProducer producer =
                new AsyncMetaMessageProducer(messageSessionFactory, this.remotingClient, this.partitionSelector,
                    this.producerZooKeeper, this.sessionId, 20000, processor);
        Assert.assertTrue(producer.getIgnoreMessageProcessor() == processor);

        EasyMock.expect(messageSessionFactory.getMetaClientConfig()).andReturn(new MetaClientConfig());
        mocksControl.replay();
        producer =
                new AsyncMetaMessageProducer(messageSessionFactory, this.remotingClient, this.partitionSelector,
                    this.producerZooKeeper, this.sessionId, 20000, null);
        Assert.assertTrue(producer.getIgnoreMessageProcessor() instanceof AsyncIgnoreMessageProcessor);
View Full Code Here


    @Override
    @Before
    public void setUp() throws Exception {
        MetaClientConfig metaClientConfig = new MetaClientConfig();
        this.sessionFactory = new MetaMessageSessionFactory(metaClientConfig);
        this.startServer("bigmessageserver");
        System.out.println("before run");
    }
View Full Code Here


    @Override
    @Before
    public void setUp() throws Exception {
        final MetaClientConfig metaClientConfig = new MetaClientConfig();
        this.sessionFactory = new XAMetaMessageSessionFactory(metaClientConfig);
        this.startServer("server1");
        System.out.println("before run");
    }
View Full Code Here

    public SimpleHttpConsumer(final HttpClientConfig config) {
        super(config);
        this.config = config;
        this.subscribeInfoManager = new SubscribeInfoManager();
        this.offsetStorage = new MysqlOffsetStorage(config.getDataSource());
        this.recoverStorageManager = new RecoverStorageManager(new MetaClientConfig(), this.subscribeInfoManager);
        this.scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
        this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
            @Override
            public void run() {
                SimpleHttpConsumer.this.commitOffsets();
View Full Code Here

        String item = commandLine.getOptionValue("item", null);
        String configFile = commandLine.getOptionValue("config");

        Properties props = ResourceUtils.getResourceAsProperties(configFile);
        MetaClientConfig metaClientConfig = new MetaClientConfig();
        String host = props.getProperty("hostName");
        if (StringUtils.isBlank(host)) {
            host = "localhost";
        }
        String serverUrl = "meta://" + host + ":" + props.getProperty("serverPort");
        metaClientConfig.setServerUrl(serverUrl);
        metaClientConfig.setZkConfig(initZkConfig(props));
        MetaMessageSessionFactory sessionFactory = new MetaMessageSessionFactory(metaClientConfig);

        sessionFactory.getRemotingClient().connect(serverUrl);
        sessionFactory.getRemotingClient().awaitReadyInterrupt(serverUrl);
View Full Code Here


    @Override
    @Before
    public void setUp() throws Exception {
        final MetaClientConfig metaClientConfig = new MetaClientConfig();
        this.sessionFactory = new XAMetaMessageSessionFactory(metaClientConfig);
        this.startServer("server1");
        System.out.println("before run");
    }
View Full Code Here


    @Before
    public void setUp() throws IOException {
        FileUtils.deleteDirectory(new File(OrderedLocalMessageStorageManager.DEFAULT_META_LOCALMESSAGE_PATH));
        final MetaClientConfig metaClientConfig = new MetaClientConfig();
        this.localMessageStorageManager = new OrderedLocalMessageStorageManager(metaClientConfig);

    }
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.client.MetaClientConfig

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.