Ejemplo n.º 1
0
  public static void main(String[] args) throws Exception {
    final Properties props = new Properties();
    props.setProperty("galaxy.nodeId", Integer.toString(nodeId));
    props.setProperty("galaxy.port", Integer.toString(7050 + nodeId));
    props.setProperty("galaxy.slave_port", Integer.toString(8050 + nodeId));

    final Grid grid = Grid.getInstance(null, props);
    grid.goOnline();

    final MyActor actor = new MyActor();
    actor.spawnThread();
    actor.register(ACTOR_NAME);

    final ActorRef<HelloMessage> ref = ActorRegistry.getActor(ACTOR_NAME);

    try {
      RequestReplyHelper.call(ref, new HelloMessage());
    } catch (Throwable e) {
      log.error("====>", e);
    }

    grid.cluster().goOffline();
  }