Package com.netflix.suro.client.example

Source Code of com.netflix.suro.client.example.ExampleClient

package com.netflix.suro.client.example;

import com.netflix.suro.ClientConfig;
import com.netflix.suro.client.SuroClient;
import com.netflix.suro.message.Message;

import java.util.Properties;

public class ExampleClient {
    public static void main(String[] args) {
        // create the client
        final Properties clientProperties = new Properties();
        clientProperties.setProperty(ClientConfig.LB_TYPE, "static");
        clientProperties.setProperty(ClientConfig.LB_SERVER, args[0]);
        clientProperties.setProperty(ClientConfig.CLIENT_TYPE, args[1]);

        SuroClient client = new SuroClient(clientProperties);

        // send the message
        for (int i = 0; i < Integer.parseInt(args[2]); ++i) {
            client.send(new Message("routingKey", "testMessage".getBytes()));
        }

        client.shutdown();
    }
}
TOP

Related Classes of com.netflix.suro.client.example.ExampleClient

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.