Examples of ZMQMessage


Examples of akka.zeromq.ZMQMessage

 
  @Override
  public void onReceive(Object message) throws Exception {

    if (message instanceof ZMQMessage) {
      ZMQMessage m = (ZMQMessage) message;
      String mesg = new String(m.payload(0));
      subSocket.tell((new ZMQMessage(new Frame(mesg
          + " Processed the workload for A"))));
    }

  }
View Full Code Here

Examples of akka.zeromq.ZMQMessage

  @Override
  public void onReceive(Object message) throws Exception {
    if (message.equals(TICK)) {
      // send a message to the replier system
      reqSocket.tell(new ZMQMessage(new Frame("Hi there! ("
          + getContext().self().hashCode() + ")->")));
      count++;
      if (count == 10)
        cancellable.cancel();
    } else if (message instanceof ZMQMessage) {
      ZMQMessage m = (ZMQMessage) message;
      String mesg = new String(m.payload(0));

      log.info("Received msg! {}", mesg);
    }
  }
View Full Code Here

Examples of akka.zeromq.ZMQMessage

  @Override
  public void onReceive(Object message) throws Exception {
    if (message.equals(TICK)) {

      if (random.nextBoolean() == true) {
        routerSocket.tell(new ZMQMessage(new Frame("A"), new Frame(
            "This is the workload for A")));
      } else {
        routerSocket.tell(new ZMQMessage(new Frame("B"), new Frame(
            "This is the workload for B")));

      }
      count++;
      if (count == 10)
        cancellable.cancel();

    } else if (message instanceof ZMQMessage) {
      ZMQMessage m = (ZMQMessage) message;
      String replier = new String(m.payload(0));
      String msg = new String(m.payload(1));
      log.info("Received message from {} with mesg -> {}", replier, msg);
    }

  }
View Full Code Here

Examples of akka.zeromq.ZMQMessage

              new Listener(getSelf()) });

  @Override
  public void onReceive(Object message) throws Exception {
    if (message instanceof ZMQMessage) {
      ZMQMessage m = (ZMQMessage) message;
      String mesg = new String(m.payload(0));

      repSocket.tell((new ZMQMessage(
          new Frame(mesg + " Good to see you!"))));
    }
  }
View Full Code Here

Examples of akka.zeromq.ZMQMessage

  @Override
  public void onReceive(Object message) throws Exception {

    if (message instanceof ZMQMessage) {
      ZMQMessage m = (ZMQMessage) message;
      String mesg = new String(m.payload(0));
      log.info("Received Message -> {}",mesg);
    }

  }
View Full Code Here

Examples of akka.zeromq.ZMQMessage

  @Override
  public void onReceive(Object message) throws Exception {

    if (message instanceof ZMQMessage) {
      ZMQMessage m = (ZMQMessage) message;
      String mesg = new String(m.payload(0));
      subSocket.tell((new ZMQMessage(new Frame(mesg
          + " Processed the workload for B"))));
    }

  }
View Full Code Here

Examples of akka.zeromq.ZMQMessage

  @Override
  public void onReceive(Object message) throws Exception {
    if (message.equals(TICK)) {

      count++;
      pushSocket.tell(new ZMQMessage(
          new Frame("Hi there (" + count + ")")));
      if (count == 5)
        cancellable.cancel();
    }
View Full Code Here

Examples of akka.zeromq.ZMQMessage

  @Override
  public void onReceive(Object message) throws Exception {

    if (message instanceof ZMQMessage) {
      ZMQMessage m = (ZMQMessage) message;
      String mesg = new String(m.payload(0));
      log.info("Received Message -> {}", mesg);
    }

  }
View Full Code Here

Examples of akka.zeromq.ZMQMessage

  }

  @Override
  public void onReceive(Object message) throws Exception {
    if (message.equals(TICK)) {
      pubSocket.tell(new ZMQMessage(new Frame("someTopic"), new Frame(
          "This is the workload " + ++count)));
     
      if(count==10)
        cancellable.cancel();
    }
View Full Code Here

Examples of akka.zeromq.ZMQMessage

  @Override
  public void onReceive(Object message) throws Exception {

    if (message instanceof ZMQMessage) {
      ZMQMessage m = (ZMQMessage) message;
      String mesg = new String(m.payload(1));
      log.info("Received Message @ A -> {}",mesg);
    }
  }
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.