Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

generator-jhipster-grpc

cbornet144Apache-2.00.22.0

Adds support for gRPC and generates gRPC CRUD services

yeoman-generator, jhipster-module, grpc

readme

generator-jhipster-grpc

NPM version Build Status Dependency Status

JHipster module, Adds support for gRPC and generates gRPC CRUD services

Introduction

This is a JHipster module, that is meant to be used in a JHipster application.

WARN : Under developpement. See list of limitations and TODOs

Prerequisites

As this is a JHipster module, we expect you have JHipster and its related tools already installed:

Installation

To install this module:

npm install -g generator-jhipster-grpc

Compatibility :

  • JHipster 4.1 and inferior (Note : never tested with <4.1.0) : module version 0.7.0
  • JHipster 4.2 and 4.3 : module version 0.8.0, 0.9.0
  • JHipster 4.4 : module version 0.10.0
  • JHipster 4.5 to 4.8 : module version 0.11.0
  • JHipster 4.9 : module version 0.12.0, 0.13.0
  • JHipster 4.10 : module version 0.14.1
  • JHipster 4.11 to 4.14 : module version 0.15.2
  • JHipster 5.0 to 5.7 : module version 0.16.0
  • JHipster 5.8: module version 0.17.0
  • JHipster 6.0: module version 0.18.0
  • JHipster 6.1 and 6.2: module version 0.19.1
  • JHipster 6.3: module version 0.20.0
  • JHipster 6.4 and 6.5: module version 0.21.2
  • JHipster master : module branch next-jhipster (nightly build status : Build Status)

Usage

At the root of your project directory:

yo jhipster-grpc

This will configure reactive-grpc and grpc-spring-boot-starter so that the proto files present in src/main/proto are compiled. If you want to add CRUD gRPC services for an entity, just (re)generate it and confirm when the question is asked. The endpoints use Reactor implementation of reactive-streams (Flux) with back-pressure.

Notes :

  • for the moment entities must have a service layer (serviceClass or serviceImpl)
  • just like with DTOs, entities that are referenced by another entity in a relationship (many-to-many owned side, many-to-one or one-to-ine owned side) currently must be grpc activated and thus have a service layer. The service layer constraint should be relaxed in a future release since it's only the gRPC mapper which is required.

TODOs:

  • <input checked="" disabled="" type="checkbox"> Generate existing entities
  • <input checked="" disabled="" type="checkbox"> Support Gradle
  • <input checked="" disabled="" type="checkbox"> Entities without DTOs
  • <input disabled="" type="checkbox"> Entities without service
  • <input checked="" disabled="" type="checkbox"> Entities with pagination
  • <input checked="" disabled="" type="checkbox"> Support Cassandra
  • <input checked="" disabled="" type="checkbox"> Support Mongo
  • <input checked="" disabled="" type="checkbox"> Support relationships
  • <input checked="" disabled="" type="checkbox"> JWT security
  • <input checked="" disabled="" type="checkbox"> OAuth2 security
  • <input checked="" disabled="" type="checkbox"> Basic auth security (used for session auth option)
  • <input checked="" disabled="" type="checkbox"> Entity javadoc
  • <input checked="" disabled="" type="checkbox"> Field javadoc
  • <input checked="" disabled="" type="checkbox"> Add ElasticSearch endpoints
  • <input checked="" disabled="" type="checkbox"> Management endpoints
    • <input checked="" disabled="" type="checkbox"> Account
    • <input checked="" disabled="" type="checkbox"> Loggers
    • <input checked="" disabled="" type="checkbox"> Audits
    • <input checked="" disabled="" type="checkbox"> Users
    • <input checked="" disabled="" type="checkbox"> Profile info
    • <input checked="" disabled="" type="checkbox"> Spring Boot Actuators
  • <input disabled="" type="checkbox"> Support streaming from the DB (Stream<> in repository)
  • <input checked="" disabled="" type="checkbox"> Support streaming back-pressure (reactive streams with rxJava2 or Reactor)
  • <input disabled="" type="checkbox"> Client-side configuration (micro-services)
  • <input disabled="" type="checkbox"> Client-side load-balancing with service discovery (micro-services)
  • <input disabled="" type="checkbox"> Generator tests
  • <input disabled="" type="checkbox"> Sample/demo project
  • <input checked="" disabled="" type="checkbox"> Generated code tests
  • <input checked="" disabled="" type="checkbox"> Travis CI

Mappings:

JHipster Protobuf
Integer int32
Long int64
String string
Float float
Double double
Boolean bool
Blob (byte[]) bytes
ByteBuffer bytes
Instant google.protobuf.Timestamp
ZonedDateTime google.protobuf.Timestamp
LocalDate util.Date
BigDecimal util.Decimal
enum enum

util.Date and util.Decimal are custom definitions. Non-required protobuf scalar types and enums are wrapped in OneOf types to provide nullability.

License

Apache-2.0 © [Christophe Bornet]