-
Notifications
You must be signed in to change notification settings - Fork 10
Getting started with QBit Microservices Lib Batteries Included
If you are new to QBit. It might make more sense to skim the overview. We suggest reading the landing page of the QBit Microservices Lib's wiki for a background on QBit. This will let you see the forrest while the tutorials are inspecting the trees. There is also a lot of documents linked to off of the wiki landing page as well as in the footer section of the tutorials.
Home <<Part 1, Part 2, Part 3 > -- -example code- -qbit docs-
This is part two in this tutorial series. Part 1
QBit is small and wicked fast, but it comes batteries included.
QBit comes with Service Discovery, Health, Monitoring, Realtime service stats, Async, Reactive Async call management, Job Control, Event Bus, built-in. QBit is very similar to the Typed Actor model but streamlined for Microservices and using idiomatic Java constructs.
Already, even the simple Hello World example has runtime stats support, health monitoring that can be integrated with service discovery, and more.
To expose end points to some of these services, we merely have to create an admin end point as follows:
public static void main(final String... args) {
final ManagedServiceBuilder managedServiceBuilder =
ManagedServiceBuilder.managedServiceBuilder().setRootURI("/root");
/* Start the service. */
managedServiceBuilder.addEndpointService(new HelloWorldService())
.getEndpointServerBuilder()
.build().startServer();
/* Start the admin builder which exposes health end-points and meta data. */
managedServiceBuilder.getAdminBuilder().build().startServer();
System.out.println("Servers started");
}
We just turn on the admin.
/* Start the admin builder which exposes health end-points and meta data. */
managedServiceBuilder.getAdminBuilder().build().startServer();
$ curl http://localhost:8080/__stats/instance
$ curl http://localhost:8080/__health
Returns "ok" if all registered health systems are healthy.
Or if same port endpoint health is disabled then:
$ curl http://localhost:7777/__admin/ok
Returns "true" if all registered health systems are healthy.
A node is a service, service bundle, queue, or server endpoint that is being monitored. List all service nodes or endpoints.
$ curl http://localhost:8080/root/hello/hello
$ curl http://localhost:7777/__admin/meta/
$ curl http://localhost:7777/__admin/all-nodes/
$ curl http://localhost:7777/__admin/healthy-nodes/
$ curl http://localhost:7777/__admin/load-nodes/
Read more:
- QBit Microservice Hello World tutorial
- QBit Microservice Hello World Part 2
- QBit Microservice Hello World Health Checks
- QBit Microservice Hello World Stats, Metrics, and Monitoring
- QBit Microservice Reactive programming tutorial
QBit is the Java microservice lib. QBit is a reactive programming lib for building microservices and focuses on JSON, HTTP, WebSocket, and REST. QBit uses reactive programming to build elastic REST, and WebSockets based cloud friendly, web services. SOA evolved for mobile and cloud. ServiceDiscovery, Health, reactive StatService, events, Java idiomatic reactive programming for Microservices.
Reactive Programming, Java Microservices, Rick Hightower
Java Microservices Architecture
[Microservice Service Discovery with Consul] (http://www.mammatustech.com/Microservice-Service-Discovery-with-Consul)
Microservices Service Discovery Tutorial with Consul
[Reactive Microservices] (http://www.mammatustech.com/reactive-microservices)
[High Speed Microservices] (http://www.mammatustech.com/high-speed-microservices)