VertxServer.start
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using io.vertx.grpc.VertxServer.start (Showing top 17 results out of 315)

origin: vert-x3/vertx-examples

 @Override
 public void start() throws Exception {
  VertxServer server = VertxServerBuilder.forAddress(vertx, "localhost", 8080).addService(new GreeterGrpc.GreeterVertxImplBase() {
   @Override
   public void sayHello(HelloRequest request, Future<HelloReply> future) {
    System.out.println("Hello " + request.getName());
    future.complete(HelloReply.newBuilder().setMessage(request.getName()).build());
   }
  }).build();
  server.start(ar -> {
   if (ar.succeeded()) {
    System.out.println("gRPC service started");
   } else {
    System.out.println("Could not start server " + ar.cause().getMessage());
   }
  });
 }
}
origin: vert-x3/vertx-examples

 @Override
 public void start() throws Exception {

  // The rcp service
  EmptyPingPongServiceGrpc.EmptyPingPongServiceVertxImplBase service = new EmptyPingPongServiceGrpc.EmptyPingPongServiceVertxImplBase() {
   @Override
   public void emptyCall(EmptyProtos.Empty request, Future<EmptyProtos.Empty> future) {
    future.complete(EmptyProtos.Empty.newBuilder().build());
   }
  };

  // Create the server
  VertxServer rpcServer = VertxServerBuilder
   .forPort(vertx, 8080)
   .addService(service)
   .build();

  // start the server
  rpcServer.start(ar -> {
   if (ar.failed()) {
    ar.cause().printStackTrace();
   }
  });
 }
}
origin: vert-x3/vertx-examples

 @Override
 public void start() throws Exception {

  // The rcp service
  PingPongServiceGrpc.PingPongServiceVertxImplBase service = new PingPongServiceGrpc.PingPongServiceVertxImplBase() {
   @Override
   public void unaryCall(Messages.SimpleRequest request, Future<Messages.SimpleResponse> future) {
    future.complete(Messages.SimpleResponse.newBuilder().setUsername("Paulo").build());
   }
  };

  // Create the server
  VertxServer rpcServer = VertxServerBuilder
   .forPort(vertx, 8080)
   .addService(service)
   .build();

  // start the server
  rpcServer.start(ar -> {
   if (ar.failed()) {
    ar.cause().printStackTrace();
   }
  });
 }
}
origin: vert-x3/vertx-examples

rpcServer.start(ar -> {
 if (ar.failed()) {
  ar.cause().printStackTrace();
origin: vert-x3/vertx-examples

 @Override
 public void start() throws Exception {

  // The rcp service
  ProducerServiceGrpc.ProducerServiceVertxImplBase service = new ProducerServiceGrpc.ProducerServiceVertxImplBase() {
   @Override
   public void streamingInputCall(GrpcReadStream<Messages.StreamingInputCallRequest> request, Future<Messages.StreamingInputCallResponse> future) {
    request.handler(payload -> {
     System.out.println(payload.getPayload().getType().getNumber());
    }).endHandler(v -> {
     System.out.println("Request has ended.");
     future.complete(Messages.StreamingInputCallResponse.newBuilder().build());
    });
   }
  };

  // Create the server
  VertxServer rpcServer = VertxServerBuilder
   .forPort(vertx, 8080)
   .addService(service)
   .build();

  // start the server
  rpcServer.start(ar -> {
   if (ar.failed()) {
    ar.cause().printStackTrace();
   }
  });
 }
}
origin: vert-x3/vertx-examples

rpcServer.start(ar -> {
 if (ar.failed()) {
  ar.cause().printStackTrace();
origin: vert-x3/vertx-examples

server.start(ar -> {
 if (ar.succeeded()) {
  System.out.println("gRPC service started");
origin: vert-x3/vertx-examples

 @Override
 public void start() throws Exception {
  VertxServer server = VertxServerBuilder.forPort(vertx, 8080)
   .addService(new GreeterGrpc.GreeterVertxImplBase() {
   @Override
   public void sayHello(HelloRequest request, Future<HelloReply> future) {
    System.out.println("Hello " + request.getName());
    future.complete(HelloReply.newBuilder().setMessage(request.getName()).build());
   }
  })
   .useSsl(options -> options
    .setSsl(true)
    .setUseAlpn(true)
    .setKeyStoreOptions(new JksOptions()
     .setPath("tls/server-keystore.jks")
     .setPassword("wibble")))
   .build();
  server.start(ar -> {
   if (ar.succeeded()) {
    System.out.println("gRPC service started");
   } else {
    System.out.println("Could not start server " + ar.cause().getMessage());
   }
  });
 }
}
origin: io.vertx/vertx-grpc

@Override
public VertxServer start() throws IOException {
 return start(ar -> {});
}
origin: io.vertx/vertx-consul-client

void start(Handler<AsyncResult<Void>> h) {
 server.start(h);
}
origin: io.vertx/vertx-grpc

 void startServer(BindableService service, VertxServerBuilder builder, Handler<AsyncResult<Void>> completionHandler) {
  server = builder
    .addService(service)
    .build()
    .start(completionHandler);
 }
}
origin: io.vertx/vertx-grpc

@Override
public void start(Future<Void> startFuture) throws Exception {
 service = new GreeterGrpc.GreeterVertxImplBase() {
  @Override
  public void sayHello(HelloRequest req, Future<HelloReply> future) {
   threads.add(Thread.currentThread());
   future.complete(HelloReply.newBuilder().setMessage("Hello " + req.getName()).build());
  }
 };
 server = VertxServerBuilder.forPort(vertx, port).addService(service).build();
 server.start(startFuture.completer());
}
origin: io.vertx/vertx-grpc

private void testInternal(TestContext ctx, Vertx vertx) {
 VertxServerBuilder.forPort(vertx, 0)
  .addService(new GreeterGrpc.GreeterImplBase() { })
  .build()
  .start(ctx.asyncAssertSuccess());
}
origin: silentbalanceyh/vertx-zero

@Override
public void start() {
  /* 1. Iterate all the configuration **/
  Ut.itMap(ZeroAtomic.RPC_OPTS, (port, config) -> {
    /* 2.Rcp server builder initialized **/
    final VertxServerBuilder builder = VertxServerBuilder
        .forAddress(this.vertx, config.getHost(), config.getPort());
    /*
     * 3.Service added.
     */
    {
      // UnityService add ( Envelop )
      final Tunnel tunnel = Ut.singleton(UnityTunnel.class);
      builder.addService(tunnel.init(this.vertx));
    }
    /*
     * 4.Server added.
     */
    final VertxServer server = builder.build();
    server.start(handler -> this.registryServer(handler, config));
  });
}
origin: cn.vertxup/vertx-up

@Override
public void start() {
  /* 1. Iterate all the configuration **/
  Ut.itMap(ZeroAtomic.RPC_OPTS, (port, config) -> {
    /* 2.Rcp server builder initialized **/
    final VertxServerBuilder builder = VertxServerBuilder
        .forAddress(this.vertx, config.getHost(), config.getPort());
    /*
     * 3.Service added.
     */
    {
      // UnityService add ( Envelop )
      final Tunnel tunnel = Ut.singleton(UnityTunnel.class);
      builder.addService(tunnel.init(this.vertx));
    }
    /*
     * 4.Server added.
     */
    final VertxServer server = builder.build();
    server.start(handler -> this.registryServer(handler, config));
  });
}
origin: io.vertx/vertx-grpc

.addService(ServerInterceptors.intercept(service, BlockingServerInterceptor.wrap(vertx, blockingInterceptor)))
.build()
.start(ar -> {
 if (ar.succeeded()) {
  started.complete();
origin: io.vertx/vertx-grpc

.addService(ServerInterceptors.intercept(service, BlockingServerInterceptor.wrap(vertx, blockingInterceptor)))
.build()
.start(ar -> {
 if (ar.succeeded()) {
  started.complete();
io.vertx.grpcVertxServerstart

Popular methods of VertxServer

  • shutdown
  • <init>
  • getPort

Popular in Java

  • Start an intent from android
  • getSystemService (Context)
  • requestLocationUpdates (LocationManager)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JFrame (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)