HealthServiceAsync.ok
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using io.advantageous.qbit.service.health.HealthServiceAsync.ok (Showing top 10 results out of 315)

  • Common ways to obtain HealthServiceAsync
private void myMethod () {
HealthServiceAsync h =
  • HealthServiceBuilder healthServiceBuilder;healthServiceBuilder.setAutoFlush().buildAndStart()
  • HealthServiceBuilder healthServiceBuilder;healthServiceBuilder.getServiceQueue().createProxy(HealthServiceAsync.class)
  • HealthServiceBuilder healthServiceBuilder;TimeUnit timeUnit;healthServiceBuilder.getServiceQueue().createProxyWithAutoFlush(HealthServiceAsync.class, int1, timeUnit)
  • Smart code suggestions by Codota
}
origin: advantageous/qbit

private void handleDiscoveryCheckInWithHealth(final AtomicLong lastCheckIn,
                       final long checkInDuration) {
  final AtomicBoolean ok = new AtomicBoolean(true);
  httpServer.setHttpRequestsIdleConsumer(aVoid -> {
    httpRequestServerHandler.httpRequestQueueIdle(null);
    long now = Timer.clockTime();
    if (now > lastCheckIn.get() + checkInDuration) {
      lastCheckIn.set(now);
      if (ok.get()) {
        serviceDiscovery.checkInOk(endpoint.getId());
      } else {
        serviceDiscovery.checkIn(endpoint.getId(), HealthStatus.FAIL);
      }
      healthServiceAsync.ok(ok::set);
      ServiceProxyUtils.flushServiceProxy(healthServiceAsync);
    }
  });
}
origin: advantageous/qbit

public void handleCheckIn() {
  if (healthServiceAsync == null) {
    if (Timer.clockTime() - lastCheckIn.get() > checkInEveryMiliDuration) {
      lastCheckIn.set(Timer.clockTime());
      serviceDiscovery.checkInOk(endpointDefinition.getId());
    }
  } else {
    if (Timer.clockTime() - lastCheckIn.get() > checkInEveryMiliDuration) {
      lastCheckIn.set(Timer.clockTime());
      healthServiceAsync.ok(ok::set);
      ServiceProxyUtils.flushServiceProxy(healthServiceAsync);
      if (ok.get()) {
        serviceDiscovery.checkInOk(endpointDefinition.getId());
      } else {
        serviceDiscovery.checkIn(endpointDefinition.getId(), HealthStatus.FAIL);
      }
      ServiceProxyUtils.flushServiceProxy(serviceDiscovery);
    }
  }
}
origin: advantageous/qbit

healthServiceAsync.ok(ok -> {
  if (ok) {
    httpRequest.getReceiver().respondOK("\"ok\"");
origin: advantageous/qbit

/**
 * Read annotation.
 *
 * @param responseCallback responseCallback
 */
@RequestMapping(value = "/ok",
    summary = "simple health check",
    description = "Health check. This returns true if all nodes (service actors) are healthy",
    returnDescription = "true if all nodes are healthy, false if all nodes are not healthy")
public void ok(final Callback<HttpTextResponse> responseCallback) {
  healthService.ok(callbackBuilder().withBooleanCallback(ok -> {
    if (ok) {
      responseCallback.resolve(httpResponseBuilder().setBody("true").setCode(200).buildTextResponse());
    } else {
      responseCallback.resolve(httpResponseBuilder().setBody("false").setCode(503).buildTextResponse());
    }
  }).build());
  healthService.clientProxyFlush();
}
origin: io.advantageous.qbit/qbit-core

private void handleDiscoveryCheckInWithHealth(final AtomicLong lastCheckIn,
                       final long checkInDuration) {
  final AtomicBoolean ok = new AtomicBoolean(true);
  httpServer.setHttpRequestsIdleConsumer(aVoid -> {
    httpRequestServerHandler.httpRequestQueueIdle(null);
    long now = Timer.clockTime();
    if (now > lastCheckIn.get() + checkInDuration) {
      lastCheckIn.set(now);
      if (ok.get()) {
        serviceDiscovery.checkInOk(endpoint.getId());
      } else {
        serviceDiscovery.checkIn(endpoint.getId(), HealthStatus.FAIL);
      }
      healthServiceAsync.ok(ok::set);
      ServiceProxyUtils.flushServiceProxy(healthServiceAsync);
    }
  });
}
origin: com.github.advantageous/qbit-core

private void handleDiscoveryCheckInWithHealth(final AtomicLong lastCheckIn,
                       final long checkInDuration) {
  final AtomicBoolean ok = new AtomicBoolean(true);
  
  httpServer.setHttpRequestsIdleConsumer(aVoid -> {
    httpRequestServerHandler.httpRequestQueueIdle(null);
    long now = Timer.clockTime();
    if (now > lastCheckIn.get() + checkInDuration) {
      lastCheckIn.set(now);
      if (ok.get()) {
        serviceDiscovery.checkInOk(endpoint.getId());
      } else {
        serviceDiscovery.checkIn(endpoint.getId(), HealthStatus.FAIL);
      }
      healthServiceAsync.ok(ok::set);
      ServiceProxyUtils.flushServiceProxy(healthServiceAsync);
    }
  });
}
public void stop() {
origin: com.github.advantageous/qbit-core

public void handleCheckIn() {
  if (healthServiceAsync == null) {
    if (Timer.clockTime() - lastCheckIn.get() > checkInEveryMiliDuration) {
      lastCheckIn.set(Timer.clockTime());
      serviceDiscovery.checkInOk(endpointDefinition.getId());
    }
  } else {
    if (Timer.clockTime() - lastCheckIn.get() > checkInEveryMiliDuration) {
      lastCheckIn.set(Timer.clockTime());
      healthServiceAsync.ok(ok::set);
      ServiceProxyUtils.flushServiceProxy(healthServiceAsync);
      if (ok.get()) {
        serviceDiscovery.checkInOk(endpointDefinition.getId());
      } else {
        serviceDiscovery.checkIn(endpointDefinition.getId(), HealthStatus.FAIL);
      }
      ServiceProxyUtils.flushServiceProxy(serviceDiscovery);
    }
  }
}
origin: io.advantageous.qbit/qbit-core

public void handleCheckIn() {
  if (healthServiceAsync == null) {
    if (Timer.clockTime() - lastCheckIn.get() > checkInEveryMiliDuration) {
      lastCheckIn.set(Timer.clockTime());
      serviceDiscovery.checkInOk(endpointDefinition.getId());
    }
  } else {
    if (Timer.clockTime() - lastCheckIn.get() > checkInEveryMiliDuration) {
      lastCheckIn.set(Timer.clockTime());
      healthServiceAsync.ok(ok::set);
      ServiceProxyUtils.flushServiceProxy(healthServiceAsync);
      if (ok.get()) {
        serviceDiscovery.checkInOk(endpointDefinition.getId());
      } else {
        serviceDiscovery.checkIn(endpointDefinition.getId(), HealthStatus.FAIL);
      }
      ServiceProxyUtils.flushServiceProxy(serviceDiscovery);
    }
  }
}
origin: io.advantageous.qbit/qbit-core

healthServiceAsync.ok(ok -> {
  if (ok) {
    httpRequest.getReceiver().respondOK("\"ok\"");
origin: com.github.advantageous/qbit-core

healthServiceAsync.ok(ok -> {
  if (ok) {
    httpRequest.getReceiver().respondOK("\"ok\"");
io.advantageous.qbit.service.healthHealthServiceAsyncok

Javadoc

Checks to see if all services registered with the health system are ok.

Popular methods of HealthServiceAsync

  • clientProxyFlush
  • checkIn
    Check in with a certain TTL.
  • checkInOk
    Check in the service so it passes it TTL
  • register
    Register a service with the health system
  • unregister
    Unregister the service
  • findAllNodes
    Find all nodes
  • findHealthyNodes
    Returns list of healthy nodes.
  • loadNodes
    Load all nodes no matter the status.

Popular in Java

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • getSupportFragmentManager (FragmentActivity)
  • getSystemService (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy

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)