Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: kafka adapter #342

Merged
merged 63 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a805288
Draft PR it is
Ruchip16 Oct 8, 2022
71768e8
Changes updated
Ruchip16 Oct 26, 2022
5889511
EoS added but WIP
Ruchip16 Nov 14, 2022
48ccbde
Consuming and producing messages
Ruchip16 Nov 17, 2022
25cdefa
Producing and consuming messages
Ruchip16 Nov 23, 2022
99a16ef
Subscriber
Ruchip16 Nov 25, 2022
de5edec
recent version
Ruchip16 Dec 6, 2022
552fe90
test-push
Ruchip16 Dec 7, 2022
9399af3
gleemessage
Ruchip16 Dec 17, 2022
c069607
umm doing some stuff
Ruchip16 Dec 17, 2022
21a6b41
WIP
Ruchip16 Dec 17, 2022
2260e9b
WIP2
Ruchip16 Dec 17, 2022
70f4021
Testing
Ruchip16 Dec 17, 2022
4574fb0
example-test
Ruchip16 Dec 18, 2022
d0c6156
Updatess
Ruchip16 Dec 19, 2022
1c24e7f
Producer WIP
Ruchip16 Dec 20, 2022
46d5195
error
Ruchip16 Dec 22, 2022
780b5ea
WIP-Producer
Ruchip16 Dec 22, 2022
20dbe47
Producer - testing
Ruchip16 Dec 22, 2022
a788a8a
Producer
Ruchip16 Dec 22, 2022
7ad0f6e
Security Pseudocode
Ruchip16 Dec 23, 2022
2794b1d
cherry pick conflicts
Ruchip16 Oct 8, 2022
2706637
conflictss
Ruchip16 Oct 8, 2022
81391c8
chpick
Ruchip16 Oct 26, 2022
3771cf8
Changes updated
Ruchip16 Oct 26, 2022
69159be
EoS added but WIP
Ruchip16 Nov 14, 2022
ae12dbd
Consuming and producing messages
Ruchip16 Nov 17, 2022
a60092a
Producing and consuming messages
Ruchip16 Nov 23, 2022
7553fba
Subscriber
Ruchip16 Nov 25, 2022
8fd7d92
recent version
Ruchip16 Dec 6, 2022
66459a5
test-push
Ruchip16 Dec 7, 2022
b86a63d
gleemessage
Ruchip16 Dec 17, 2022
25b1716
umm doing some stuff
Ruchip16 Dec 17, 2022
010a275
WIP
Ruchip16 Dec 17, 2022
2b867e5
WIP2
Ruchip16 Dec 17, 2022
ca80a45
Testing
Ruchip16 Dec 17, 2022
6749366
example-test
Ruchip16 Dec 18, 2022
e41e453
Updatess
Ruchip16 Dec 19, 2022
eee69b5
Producer WIP
Ruchip16 Dec 20, 2022
2ab7767
error
Ruchip16 Dec 22, 2022
5281e59
WIP-Producer
Ruchip16 Dec 22, 2022
cd2ca10
Producer - testing
Ruchip16 Dec 22, 2022
bee0aa7
Producer
Ruchip16 Dec 22, 2022
a9ee43b
Security Pseudocode
Ruchip16 Dec 23, 2022
9676574
Conflict resolved
Ruchip16 Jan 11, 2023
b008e36
Conflicts resolving ..
Ruchip16 Jan 11, 2023
25091f9
Security WIP
Ruchip16 Jan 12, 2023
fed4ce3
++security
Ruchip16 Jan 12, 2023
51d2a87
Updatesss
Ruchip16 Jan 13, 2023
541ce52
v1 security
Ruchip16 Jan 17, 2023
e2c2587
just updating over here
Ruchip16 Jan 19, 2023
9548794
Included security requirements
Ruchip16 Jan 20, 2023
6abf362
Security mechanism
Ruchip16 Jan 23, 2023
60d632d
SSL Authentication
Ruchip16 Jan 23, 2023
751795c
Review Changes done
Ruchip16 Jan 24, 2023
6f442a1
Updating changes
Ruchip16 Jan 25, 2023
87db040
Merge remote-tracking branch 'origin/kafka-adapter' into kafka-adapter
Ruchip16 Jan 25, 2023
12a374d
Merge branch 'master' of https://github.com/asyncapi/glee into kafka-…
Ruchip16 Jan 25, 2023
75f6d4a
Pushing changes
Ruchip16 Jan 25, 2023
dfe1bf4
Lint Test Fix
Ruchip16 Jan 25, 2023
03563f8
final commit
Ruchip16 Jan 25, 2023
c3fc810
rebuilding package-lock.json
fmvilas Jan 25, 2023
1c32946
increase warnings
fmvilas Jan 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
.DS_Store
dist
coverage
.vscode
.vscode
local.env
fmvilas marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions examples/dummy - Copy/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GLEE_SERVER_NAMES=mykafka
GLEE_SERVER_CERTS=mosquitto:mosquitto.org.crt
fmvilas marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions examples/dummy - Copy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.glee
3 changes: 3 additions & 0 deletions examples/dummy - Copy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Dummy

This is a dummy example mainly used to test functionalities.
18 changes: 18 additions & 0 deletions examples/dummy - Copy/asyncapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
asyncapi: 2.0.0
info:
title: Kafka test
version: 1
servers:
mykafka:
url: https://pkc-6ojv2.us-west4.gcp.confluent.cloud:443
protocol: kafka-secure
channels:
test:
publish:
operationId: onTest
message:
payload:
type: object
properties:
test:
type: string
32 changes: 32 additions & 0 deletions examples/dummy - Copy/customServer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* eslint-disable no-undef, security/detect-non-literal-fs-filename */
fmvilas marked this conversation as resolved.
Show resolved Hide resolved

import { fileURLToPath } from 'url'
import path, { dirname } from 'path'
import fs from 'fs'
import { createServer } from 'http'

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

const server = createServer((req, res) => {
let pathname

try {
pathname = new URL(req.url).pathname
} catch (e) {
pathname = req.url
}

if (pathname === '/socket.io') {
res.end(fs.readFileSync(path.resolve(__dirname, '../socket.io.html'), { encoding: 'utf-8' }))
} else if (pathname === '/') {
res.end(fs.readFileSync(path.resolve(__dirname, '../index.html'), { encoding: 'utf-8' }))
} else {
res.writeHead(404).end()
}
}).listen(3005, (err) => {
if (err) throw err
console.log('Custom server running on http://localhost:3005')
})

export default server
3 changes: 3 additions & 0 deletions examples/dummy - Copy/functions/onTest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default async function (event) {
console.log(event)
}
15 changes: 15 additions & 0 deletions examples/dummy - Copy/glee.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// import customServer from './customServer.js'
fmvilas marked this conversation as resolved.
Show resolved Hide resolved

export default async function () {
return {
// websocket: {
// httpServer: customServer,
// adapter: 'native', // Default. Can also be 'socket.io' or a reference to a custom adapter.
// },
// cluster: {
// adapter: 'redis',
// name: 'gleeCluster',
// url: 'redis://localhost:6379'
// }
}
}
15 changes: 15 additions & 0 deletions examples/dummy - Copy/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script>
fmvilas marked this conversation as resolved.
Show resolved Hide resolved
const serverAnnounceSocket = new WebSocket('ws://localhost:3005/ws/server/announce')
const userSignedUpSocket = new WebSocket('ws://localhost:3005/ws/user/signedup?salutation=Hola')

function logMessage (event) {
console.log(JSON.parse(event.data))
}

serverAnnounceSocket.addEventListener('message', logMessage)
userSignedUpSocket.addEventListener('message', logMessage)

userSignedUpSocket.addEventListener('open', () => {
// userSignedUpSocket.send('{"displayName": "Fran Mendez", "email": "[email protected]"}')
})
</script>
14 changes: 14 additions & 0 deletions examples/dummy - Copy/lifecycle/announceServer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default async function () {
fmvilas marked this conversation as resolved.
Show resolved Hide resolved
return {
send: [{
server: 'mosquitto',
channel: 'server/announce',
payload: {
id: process.env.SERVER_ID || String(Date.now()),
}
}]
}
}

export const lifecycleEvent = 'onConnect'
export const servers = ['mosquitto']
24 changes: 24 additions & 0 deletions examples/dummy - Copy/mosquitto.org.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-----BEGIN CERTIFICATE-----
fmvilas marked this conversation as resolved.
Show resolved Hide resolved
MIIEAzCCAuugAwIBAgIUBY1hlCGvdj4NhBXkZ/uLUZNILAwwDQYJKoZIhvcNAQEL
BQAwgZAxCzAJBgNVBAYTAkdCMRcwFQYDVQQIDA5Vbml0ZWQgS2luZ2RvbTEOMAwG
A1UEBwwFRGVyYnkxEjAQBgNVBAoMCU1vc3F1aXR0bzELMAkGA1UECwwCQ0ExFjAU
BgNVBAMMDW1vc3F1aXR0by5vcmcxHzAdBgkqhkiG9w0BCQEWEHJvZ2VyQGF0Y2hv
by5vcmcwHhcNMjAwNjA5MTEwNjM5WhcNMzAwNjA3MTEwNjM5WjCBkDELMAkGA1UE
BhMCR0IxFzAVBgNVBAgMDlVuaXRlZCBLaW5nZG9tMQ4wDAYDVQQHDAVEZXJieTES
MBAGA1UECgwJTW9zcXVpdHRvMQswCQYDVQQLDAJDQTEWMBQGA1UEAwwNbW9zcXVp
dHRvLm9yZzEfMB0GCSqGSIb3DQEJARYQcm9nZXJAYXRjaG9vLm9yZzCCASIwDQYJ
KoZIhvcNAQEBBQADggEPADCCAQoCggEBAME0HKmIzfTOwkKLT3THHe+ObdizamPg
UZmD64Tf3zJdNeYGYn4CEXbyP6fy3tWc8S2boW6dzrH8SdFf9uo320GJA9B7U1FW
Te3xda/Lm3JFfaHjkWw7jBwcauQZjpGINHapHRlpiCZsquAthOgxW9SgDgYlGzEA
s06pkEFiMw+qDfLo/sxFKB6vQlFekMeCymjLCbNwPJyqyhFmPWwio/PDMruBTzPH
3cioBnrJWKXc3OjXdLGFJOfj7pP0j/dr2LH72eSvv3PQQFl90CZPFhrCUcRHSSxo
E6yjGOdnz7f6PveLIB574kQORwt8ePn0yidrTC1ictikED3nHYhMUOUCAwEAAaNT
MFEwHQYDVR0OBBYEFPVV6xBUFPiGKDyo5V3+Hbh4N9YSMB8GA1UdIwQYMBaAFPVV
6xBUFPiGKDyo5V3+Hbh4N9YSMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL
BQADggEBAGa9kS21N70ThM6/Hj9D7mbVxKLBjVWe2TPsGfbl3rEDfZ+OKRZ2j6AC
6r7jb4TZO3dzF2p6dgbrlU71Y/4K0TdzIjRj3cQ3KSm41JvUQ0hZ/c04iGDg/xWf
+pp58nfPAYwuerruPNWmlStWAXf0UTqRtg4hQDWBuUFDJTuWuuBvEXudz74eh/wK
sMwfu1HFvjy5Z0iMDU8PUDepjVolOCue9ashlS4EB5IECdSR2TItnAIiIwimx839
LdUdRudafMu5T5Xma182OC0/u/xRlEm+tvKGGmfFcN0piqVl8OrSPBgIlb+1IKJE
m/XriWr/Cq4h/JfB7NTsezVslgkBaoU=
-----END CERTIFICATE-----
Loading