Skip to content

Commit

Permalink
Ringbuffer mods to pick the correct hz ring
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankit authored and Ankit committed Jun 11, 2020
2 parents 4e8e026 + afdb73a commit 5a1aeda
Show file tree
Hide file tree
Showing 12 changed files with 570 additions and 433 deletions.
96 changes: 89 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ docker pull camunda/zeebe-simple-monitor:latest
* ensure that a Zeebe broker is running with a Hazelcast exporter (>= 0.8.0-alpha1)
* forward the Hazelcast port to the docker container (default: `5701`)
* configure the connection to the Zeebe broker by setting `zeebe.client.broker.contactPoint` (default: `localhost:26500`)
* configure the connection to Hazelcast by setting `zeebe.worker.hazelcast.connection` (default: `localhost:5701`)
* configure the connection to Hazelcast by setting `zeebe.client.worker.hazelcast.connection` (default: `localhost:5701`)

For a local setup, the repository contains a [docker-compose file](docker/docker-compose.yml). It starts a Zeebe broker with the Hazelcast exporter and the application.

Expand All @@ -48,7 +48,7 @@ Go to http://localhost:8082

### Configuration

The worker is a Spring Boot application that uses the [Spring Zeebe Starter](https://github.com/zeebe-io/spring-zeebe). The configuration can be changed via environment variables or an `application.yaml` file. See also the following resources:
The application is a Spring Boot application that uses the [Spring Zeebe Starter](https://github.com/zeebe-io/spring-zeebe). The configuration can be changed via environment variables or an `application.yaml` file. See also the following resources:
* [Spring Zeebe Configuration](https://github.com/zeebe-io/spring-zeebe#configuring-zeebe-connection)
* [Spring Boot Configuration](https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config)

Expand All @@ -57,19 +57,20 @@ By default, the port is set to `8082` and the database is only in-memory (i.e. n
```
zeebe:
worker:
hazelcast:
connection: localhost:5701
client:
broker.contactPoint: 127.0.0.1:26500
security.plaintext: true
worker:
hazelcast:
connection: localhost:5701
connectionTimeout: PT30S
spring:
datasource:
url: jdbc:h2:mem:zeebe-monitor;DB_CLOSE_DELAY=-1
user: sa
username: sa
password:
driverClassName: org.h2.Driver
Expand All @@ -82,6 +83,87 @@ server:
port: 8082
```

Using a different database, for example, PostgreSQL:

* change the following database configuration settings

```
- spring.datasource.url=jdbc:postgresql://db:5432/postgres
- spring.datasource.username=postgres
- spring.datasource.password=zeebe
- spring.datasource.driverClassName=org.postgresql.Driver
- spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
```

* add the database driver JAR to the classpath
* using docker, the JAR should be mounted to the `/app/libs/` folder (e.g. `/app/libs/postgresql-42.2.12.jar`)


<details>
<summary>Full docker-compose.yml with PostgreSQL</summary>
<p>

```
version: "2"
networks:
zeebe_network:
driver: bridge
services:
zeebe:
container_name: zeebe_broker
image: camunda/zeebe:0.23.0
environment:
- ZEEBE_LOG_LEVEL=debug
ports:
- "26500:26500"
- "9600:9600"
- "5701:5701"
volumes:
- ../target/exporter/zeebe-hazelcast-exporter.jar:/usr/local/zeebe/exporters/zeebe-hazelcast-exporter.jar
- ./application.yaml:/usr/local/zeebe/config/application.yaml
networks:
- zeebe_network
monitor:
container_name: zeebe-simple-monitor
image: camunda/zeebe-simple-monitor:latest
environment:
- zeebe.client.broker.contactPoint=zeebe:26500
- zeebe.worker.hazelcast.connection=zeebe:5701
- spring.datasource.url=jdbc:postgresql://db:5432/postgres
- spring.datasource.username=postgres
- spring.datasource.password=zeebe
- spring.datasource.driverClassName=org.postgresql.Driver
- spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
volumes:
- ./lib/postgresql-42.2.12.jar:/app/libs/postgresql-42.2.12.jar
ports:
- "8082:8082"
depends_on:
- zeebe
- db
networks:
- zeebe_network
db:
image: postgres:12.2
restart: always
environment:
POSTGRES_PASSWORD: zeebe
volumes:
- database-data:/var/lib/postgresql/data/
networks:
- zeebe_network
volumes:
database-data:
```

</p>
</details>

## Build from Source

Build with Maven
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:
image: camunda/zeebe-simple-monitor:latest
environment:
- zeebe.client.broker.contactPoint=zeebe:26500
- zeebe.worker.hazelcast.connection=zeebe:5701
- zeebe.client.worker.hazelcast.connection=zeebe:5701
ports:
- "8082:8082"
depends_on:
Expand Down
Loading

0 comments on commit 5a1aeda

Please sign in to comment.