Skip to content

Building suro client and server

Jae Hyeon Bae edited this page Sep 1, 2014 · 11 revisions

How to Build source code

With the following simple gradle wrapper command, you can build suro libraries.

./gradlew build

Maven references

For file backed queue, we're using BigQueue library. Since BigQueue is not deployed to the maven central, we need to add the following additional maven reference.

<dependency>
  <groupId>com.leansoft</groupId>
  <artifactId>bigqueue</artifactId>
  <version>0.7.0</version>
</dependency>

<repository>
  <id>github.release.repo</id>
  <url>https://raw.github.com/bulldog2011/bulldog-repo/master/repo/releases/</url>
</repository>

For the suro-client

<dependency>
  <groupId>com.netflix.suro</groupId>
  <artifactId>suro-client</artifactId>
  <version>0.2.9</version>
</dependency>

For the suro-server

<dependency>
  <groupId>com.netflix.suro</groupId>
  <artifactId>suro-server</artifactId>
  <version>0.2.9</version>
</dependency>

Sample Suro Client

After setting the dependency com.netflix.suro:suro-client:<latest version>, you can create a Suro client as shown by the following sample code.

Only two properties are required:

  • client's load balancer type
  • client's server information.

All other properties have default values.

final Properties clientProperties = new Properties();
clientProperties.setProperty(ClientConfig.LB_TYPE, "static");
clientProperties.setProperty(ClientConfig.LB_SERVER, "localhost:7101");
    
SuroClient client = new SuroClient(clientProperties);
client.send(new Message("routingKey", "testMessage".getBytes()));
...
client.shutdown();

Starting suro server

If you don't need to customize any sink plugins, you can use suro-server-<version number>.jar directly without any further packaging. There are six command line arguments.

  • -p : Properties file path. Not required, if missing, all default server values would be used.
  • -m : Routing map json file path. Required even though you set up this property at Archaius backend.
  • -s : Sink configuration json file path. Required as routing map json file path.
  • -i : Input source properties file path. Required
  • -c : control port number, optional, default value is 9090
  • -a : AWS access key, optional
  • -k : AWS secret key, optional
java -cp <library path> com.netflix.suro.SuroServer -m conf/routingmap.json -s conf/sink.json -i conf/input.json
Clone this wiki locally