Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dylibso/xtp-kafka-demo

Pluggable Stream Processing with Kafka + XTP
https://github.com/dylibso/xtp-kafka-demo

chicory connect financial-analysis java kafka stream webassembly xtp

Last synced: 15 days ago
JSON representation

Pluggable Stream Processing with Kafka + XTP

Awesome Lists containing this project

README

        

# An XTP + Kafka example project

## Requirements

- XTP CLI
- JDK 17+
- Docker (or similar) for the Kafka test container

## Structure

- **plugins** contains the XTP plugins
- **app** contains the Quarkus application.

## Building Plugins

- Each plugin is in its own folder under `plugins`
- Customize their `xtp.toml` with:

```
app_id = ""
bin = "dist/plugin.wasm"
extension_point_id = ""
```

`app_id` and `extension_point_id` for your own app
- Build each plug-in with `xtp plugin build` or run `make` from the top directory (`plugins`)

## Building and Starting the Java Service

Create a `.env` file in the root of the `app` directory with the following contents:

```
xtp.token=
xtp.guest-key=
xtp.extension-point=
xtp.user=
```

The user ID is a string that looks like `usr_`

### Building

```
cd app
./mvnw verify
```

### Starting
```
cd app
./mvnw quarkus:dev
```

The Quarkus DevTools will automatically start and shutdown a
Kafka broker listening on `localhost:9092`.

### Building a Self-Contained App

```
cd app
./mvnw package
```

Start with:

```
java -jar target/quarkus-app/quarkus-run.jar
```

Make sure that a local Kafka instance is listening on `localhost:9092`.

### Building a Native Image
```
cd app
./mvnw package -Dnative
```

Start with:

```
./target/quarkus-xtp-kafka-demo-1.0.0-SNAPSHOT-runner
```

Make sure that a local Kafka instance is listening on `localhost:9092`.