Package com.kurento.kmf.thrift.jsonrpcconnector

Examples of com.kurento.kmf.thrift.jsonrpcconnector.JsonRpcClientThrift


      Address kmfAddress = getThriftKmfAddress(prefix);

      log.info("kmsThriftAddress: {} and kmfThriftAddress: {}",
          kmsAddress, kmfAddress);

      client = new JsonRpcClientThrift(kmsAddress.getHost(),
          kmsAddress.getPort(), kmfAddress.getHost(),
          kmfAddress.getPort());

      break;
View Full Code Here


  private JsonRpcClient client;

  public RabbitMqConnectorManager(Address thriftKmsAddress,
      Address thriftKmfAddress, Address rabbitMqAddress) {

    this.client = new JsonRpcClientThrift(thriftKmsAddress.getHost(),
        thriftKmsAddress.getPort(), thriftKmfAddress.getHost(),
        thriftKmfAddress.getPort());

    log.info("Starting RabbitMQ to Thrift Media Connector");
View Full Code Here

  private JsonRpcServerThrift server;

  @Override
  protected JsonRpcClient createJsonRpcClient() {
    return new JsonRpcClientThrift("127.0.0.1", 6463, "127.0.0.1", 7979);
  }
View Full Code Here

    MediaPipelineFactory mpf = new MediaPipelineFactory(
        new JsonRpcClientRabbitMq());

    JsonRpcServerRabbitMq server = new JsonRpcServerRabbitMq(
        new JsonRpcClientThrift());

    server.start();

    MediaPipeline pipeline = mpf.create();
View Full Code Here

      ThriftInterfaceExecutorService executorService = new ThriftInterfaceExecutorService(
          thriftInterfaceConfiguration());

      MediaApiConfiguration mediaApiConfiguration = mediaApiConfiguration();

      JsonRpcClient client = new JsonRpcClientThrift(clientPool,
          executorService, new InetSocketAddress(
              mediaApiConfiguration.getHandlerAddress(),
              mediaApiConfiguration.getHandlerPort()));

      return new MediaPipelineFactory(client);
View Full Code Here

    server.start();
    log.info("Server started");

    log.info("Starting client");

    JsonRpcClient client = new JsonRpcClientThrift("127.0.0.1", 19292,
        "127.0.0.1", 7979);

    Params params = new Params();
    params.param1 = "Value1";
    params.param2 = "Value2";

    Params result = client.sendRequest("echo", params, Params.class);

    log.info("Response:" + result);

    Assert.assertEquals(params.param1, result.param1);
    Assert.assertEquals(params.param2, result.param2);

    client.close();

    log.info("Client finished");

    server.destroy();
View Full Code Here

    server.destroy();
  }

  protected JsonRpcClient createJsonRpcClient() {

    return new JsonRpcClientThrift(LOCALHOST, THRIFT_SERVER_PORT,
        LOCALHOST, THRIFT_CLIENT_PORT);
  }
View Full Code Here

    log.info("Server started");

    long initTime = System.nanoTime();

    log.info("Starting client");
    JsonRpcClient client = new JsonRpcClientThrift("127.0.0.1", 19292,
        "127.0.0.1", 7979);

    if (!latch.await(15, TimeUnit.SECONDS)) {
      Assert.fail("Timeout of 15s waiting for keepAlives");
    } else {
      long duration = ((System.nanoTime() - initTime) / 1000000);

      Assert.assertTrue(
          "Waiting time should be greather than estimated keepAlive time ("
              + duration + " > " + (NUM_KEEP_ALIVES * 1000) + ")",
          duration > NUM_KEEP_ALIVES * 1000);

      Assert.assertTrue("Waiting time should be a bit more than "
          + NUM_KEEP_ALIVES + " keepAlive times (" + duration + " < "
          + ((NUM_KEEP_ALIVES + 3) * 1000) + ")",
          duration < (NUM_KEEP_ALIVES + 3) * 1000);

    }

    client.close();

    log.info("Client finished");

    server.destroy();

View Full Code Here

TOP

Related Classes of com.kurento.kmf.thrift.jsonrpcconnector.JsonRpcClientThrift

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.