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

Rama sad #1

Merged
merged 4 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
13 changes: 13 additions & 0 deletions consumer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM alpine

RUN apk update && apk add nodejs

RUN apk update && apk add git

RUN apk update && apk add python3

COPY . /consumer

WORKDIR /consumer

CMD [ "node","consumer.js" ]
1 change: 1 addition & 0 deletions consumer.js → consumer/consumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const main = async () => {

await consumer.run({
eachMessage: async ({ message }) => {
console.log("Trabajo recibido")
const addr = message.value.toString().slice(1,-1)
const auth = message.key.toString()

Expand Down
18 changes: 18 additions & 0 deletions consumer/kafka.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { Kafka } = require('kafkajs')
const brokers = [process.env.KAFKA_BROKER_SERVER]
const clientId = process.env.KEYCLOAK_CLIENTID
const username = ''
const password = ''

const sasl = username && password ? { username, password, mechanism: 'plain' } : null
const ssl = !!sasl

const kafka = new Kafka({ clientId, brokers /*ssl sasl*/ })

/*
const groupId= 'Grupo'
const producer = kafka.producer()
const consumer = kafka.consumer({ groupId })
const admin = kafka.admin()
*/
module.exports = kafka
1 change: 1 addition & 0 deletions consumer/node_modules/.bin/chromedriver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions consumer/node_modules/.bin/extract-zip

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions consumer/node_modules/.bin/mime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions consumer/node_modules/.bin/nodemon

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions consumer/node_modules/.bin/nodetouch

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions consumer/node_modules/.bin/nopt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions consumer/node_modules/.bin/rimraf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions consumer/node_modules/.bin/seek-bunzip

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions consumer/node_modules/.bin/seek-table

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions consumer/node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions consumer/node_modules/.bin/uuid

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions consumer/node_modules/.bin/which

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading