Skip to content

Commit

Permalink
feat: add proto producer, improved proto consumer, add topic sizes (#50)
Browse files Browse the repository at this point in the history
* wip

* wip working

* wip - update FE

* produce via web

* fix: add string producer

* add auto deserilization

* fix: add size

* fix: insert schema id when subject not avail

* fix: auto detect descriptor

* add offset strategy proto

* fix: fix compilation

* fix: sbt dev

* fix: bump zio-kafka

* fix: udate offset strategy

* fix: validate cluster id

* fix: add scalafix

* fix: bump kafka embeded, fmt

* fmt

* fix: remove commented code

* build on m2 🤯

* fix css

* set reset offset to earliest on manual retrieval

* sort by timestamp, fix selecting schema id

* add schema id while listing proto messages, fix reading null values

* fix: reset envoy hosts
  • Loading branch information
cipriansofronia authored Nov 3, 2023
1 parent 13d91a2 commit 7f02b1f
Show file tree
Hide file tree
Showing 54 changed files with 1,436 additions and 744 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Scala CI

on:
push:
branches: [ master ]
branches: [ master, series/0.x ]
pull_request:
branches: [ master ]
branches: [ master, series/0.x ]

jobs:
build:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ revision.txt
.DS_Store
local.sbt
site/build
kafkamate.json
kafkamate.json
null
20 changes: 20 additions & 0 deletions .scalafix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
rules = [
OrganizeImports
]

OrganizeImports {
blankLines = Auto
coalesceToWildcardImportThreshold = 5
expandRelative = true
groupExplicitlyImportedImplicitsSeparately = false
groupedImports = AggressiveMerge
groups = [
"re:(javax?|scala)\\.", # language
"re:^(?!javax?\\.|scala\\.|com\\.investsuite).*", # library
"*"
]
importSelectorsOrder = Ascii
importsOrder = Ascii
preset = DEFAULT
removeUnused = true
}
43 changes: 24 additions & 19 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
version = "2.7.5"
version = "3.5.9"
runner.dialect = scala213
align.preset = some
maxColumn = 120
align.preset = most
align.multiline = false
continuationIndent.defnSite = 2
assumeStandardLibraryStripMargin = true
docstrings = JavaDoc
lineEndings = preserve
includeCurlyBraceInSelectChains = false
danglingParentheses.preset = true
optIn.annotationNewlines = true
newlines.alwaysBeforeMultilineDef = false

rewrite.rules = [RedundantBraces]
align.tokens = [
{code = "%", owner = "Term.ApplyInfix"},
{code = "%%", owner = "Term.ApplyInfix"},
{code = "%%%", owner = "Term.ApplyInfix"},
{code = "=>", owner = "Case"}
]

align.openParenCallSite = false

newlines.source=keep
newlines.topLevelStatements = [before]
newlines.beforeMultiline = keep
newlines.topLevelStatementsMinBreaks = 1

optIn.breakChainOnFirstMethodDot = true

continuationIndent.defnSite = 2

project.excludeFilters = []
verticalMultiline.atDefnSite = true
verticalMultiline.arityThreshold = 3
verticalMultiline.newlineAfterOpenParen = true

rewrite.redundantBraces.generalExpressions = false
rewriteTokens = {
"⇒": "=>"
"→": "->"
"←": "<-"
}
danglingParentheses.callSite = false
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,36 @@ This mount `-v /your/path/to/kafkamate.json:/kafkamate.json` is needed if you wa
If this is skipped then it will start with no configuration.

### Run locally
Start the site with (make sure to have already installed `npm`):
Start the site with (make sure to have already installed `npm` and add env `export NODE_OPTIONS=--openssl-legacy-provider` if errors pop up):
```bash
➜ sbt dev
```

In another shell tab start the service:
```bash
➜ sbt service/run
# or: sbt service/reStart
```

We need also to start the Envoy proxy to forward the browser's gRPC-Web requests to the backend:
```bash
# if you're using linux
➜ docker run --rm -d --net host -v "$(pwd)"/build/envoy.yaml:/etc/envoy/envoy.yaml:ro envoyproxy/envoy:v1.15.0
# if you're using macos, then try the next one
➜ docker run --platform linux/amd64 --rm -p 61234:61234 --add-host host.docker.internal:192.168.0.114 -v "$(pwd)"/build/envoy.yaml:/etc/envoy/envoy.yaml:ro envoyproxy/envoy:v1.15.0 -c /etc/envoy/envoy.yaml -l debug
# if you're using windows, then try the next one
➜ docker run --rm -d -p 61234:61234 --add-host host.docker.internal:192.168.0.114 -v %cd%\build\envoy.yaml:/etc/envoy/envoy.yaml:ro envoyproxy/envoy:v1.15.0 -c /etc/envoy/envoy.yaml -l debug
```

### Build docker image
```bash
➜ sbt dockerize
```
Steps to build on MacBook (M2) multi-architecture images using QEMU:
- `docker buildx version`
- `docker buildx create --use`
- `docker buildx inspect --bootstrap`
- `docker buildx build --platform linux/amd64 -t csofronia/kafkamate:latest -f Dockerfile . --load` (cd to target/docker)


### KAFKA TRADEMARK DISCLAIMER
Expand Down
Loading

0 comments on commit 7f02b1f

Please sign in to comment.