Git Product home page Git Product logo

eze-java's Introduction

Community badge: Incubating Community extension badge Compatible with: Camunda Platform 8

Embedded Zeebe engine (Java)

A lightweight version of Zeebe from Camunda. It bundles Zeebe's workflow engine including some required libraries so that it can be included in Java projects.

Important note: This project is a community effort not maintained by Camunda and not supported for production usage. Use at your own risk. Additionally, there is also the EZE community project, providing an in-memory engine mostly used for JUnit tests. The main differences of EZE Java are the usage of Java instead of Kotlin, and the use of RockDB for storage instead of a complete in-memory solution.

Features:

  • Support Zeebe clients and exporters
  • Use RocksDB database for the state

Usage

Maven

Add one of the following dependency to your project (i.e. Maven pom.xml):

For the embedded engine:

<dependency>
  <groupId>org.camunda.community</groupId>
  <artifactId>eze-java</artifactId>
  <version>1.0.1-SNAPSHOT</version>
</dependency>

For the Spring Boot Starter:

<dependency>
  <groupId>org.camunda.community</groupId>
  <artifactId>spring-eze-starter</artifactId>
  <version>1.0.1-SNAPSHOT</version>
</dependency>

Bootstrap the Engine

Use the factory to create a new engine.

ZeebeEngine engine = EngineFactory.create()

or

BrokerCfg cfg = new BrokerCfg();
ZeebeEngine engine = EngineFactory.create(cfg)


engine.start()
// ...
engine.stop()

Please note, using the spring-eze-starter will automatically manage the life cycle of the ZeebeEngine (start, stop)

Connect a Zeebe Client

The engine includes an embedded gRPC gateway to support interactions with Zeebe clients.

Use the factory method of the engine to create a preconfigured Zeebe client.

ZeebeClient client = engine.createClient()

Or, create your own Zeebe client using the provided gateway address from the engine.

ZeebeClient client = ZeebeClient.newClientBuilder()
  .gatewayAddress(engine.getGatewayAddress())
  .usePlaintext()
  .build()

Or, inject the ZeebeClient with Spring Boot Starter

@Autowired
private ZeebeClient client;

Configuration

The spring-eze-starter is a Spring Boot Starter application. The configuration can be changed an application.yaml file.

eze:
  network:
    host: 0.0.0.0
    port: 26500
  data:
    directory: data
    logSegmentSize: 10MB
    snapshotPeriod: 5m
  exporters:
    elasticsearch:
      class-name: io.camunda.zeebe.exporter.ElasticsearchExporter
      args:
        url: http://localhost:9200
        index:
          prefix: zeebe-record
          createTemplate: true

          numberOfShards: 3
          numberOfReplicas: 0

          command: false
          event: true
          rejection: false

          deployment: false
          process: true
          error: true
          incident: true
          job: true
          jobBatch: false
          message: false
          messageSubscription: false
          variable: true
          variableDocument: true
          processInstance: true
          processInstanceCreation: false
          processMessageSubscription: false

Example

There is a full example, including test cases. Further, you might want to have a look into the example folder.

eze-java's People

Contributors

berndruecker avatar dependabot[bot] avatar lzgabel avatar vil02 avatar xomiamoore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ruhuansanmei

eze-java's Issues

Discuss applicability of EZE

Thanks, @lzgabel for this initiative.

At the moment the EZE setup is nothing we support for any production use case - this has to be made very clear in the README.

PS: I am personally skeptical if it is a good idea to push this idea now - when most projects would benefit from the discussion on how to work without an embedded engine.

Explain difference to https://github.com/camunda-community-hub/eze/

There was an immediate discussion what the differences between this project compared to https://github.com/camunda-community-hub/eze/ are. This should also be added to the readme clearly, at the moment it is complete guesswork why there are two community projects doing rather the same.

Internal guesswork was: Java vs. Kotlin and the use of RockDB vs. in-memory DB seem to be the differentiators.

Another question was if this could also be solved by contributing to https://github.com/camunda-community-hub/eze/ instead of rewriting it? Happy to discuss this too - but foremost I wanted to add an issue that we need to document differentiators to not confuse people. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.