{"id":13783360,"url":"https://github.com/nodefluent/gcloud-pubsub-kafka-connect","last_synced_at":"2025-04-26T13:30:52.297Z","repository":{"id":22603923,"uuid":"96786828","full_name":"nodefluent/gcloud-pubsub-kafka-connect","owner":"nodefluent","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-12T07:08:29.000Z","size":1559,"stargazers_count":4,"open_issues_count":26,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T07:54:11.576Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nodefluent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-10T14:27:52.000Z","updated_at":"2020-09-13T12:15:25.000Z","dependencies_parsed_at":"2023-01-14T13:30:34.387Z","dependency_job_id":null,"html_url":"https://github.com/nodefluent/gcloud-pubsub-kafka-connect","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodefluent%2Fgcloud-pubsub-kafka-connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodefluent%2Fgcloud-pubsub-kafka-connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodefluent%2Fgcloud-pubsub-kafka-connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodefluent%2Fgcloud-pubsub-kafka-connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodefluent","download_url":"https://codeload.github.com/nodefluent/gcloud-pubsub-kafka-connect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224036170,"owners_count":17245029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T19:00:19.773Z","updated_at":"2024-11-11T01:36:16.500Z","avatar_url":"https://github.com/nodefluent.png","language":"JavaScript","funding_links":[],"categories":["Development"],"sub_categories":["Connectors"],"readme":"# gcloud-pubsub-kafka-connect\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/nodefluent/gcloud-pubsub-kafka-connect.svg)](https://greenkeeper.io/)\nKafka Connect connector for Google Cloud's PubSub\n\n[![Build Status](https://travis-ci.org/nodefluent/glouc-pubsub-kafka-connect.svg?branch=master)](https://travis-ci.org/nodefluent/glouc-pubsub-kafka-connect)\n\n[![Coverage Status](https://coveralls.io/repos/github/nodefluent/glouc-pubsub-kafka-connect/badge.svg?branch=master)](https://coveralls.io/github/nodefluent/glouc-pubsub-kafka-connect?branch=master)\n\n## Use API\n\n```\nnpm install --save glouc-pubsub-kafka-connect\n```\n\n### pubsub -\u003e kafka\n\n```es6\nconst { runSourceConnector } = require(\"glouc-pubsub-kafka-connect\");\nrunSourceConnector(config, [], onError).then(config =\u003e {\n    //runs forever until: config.stop();\n});\n```\n\n### kafka -\u003e pubsub\n\n```es6\nconst { runSinkConnector } = require(\"glouc-pubsub-kafka-connect\");\nrunSinkConnector(config, [], onError).then(config =\u003e {\n    //runs forever until: config.stop();\n});\n```\n\n### kafka -\u003e pubsub (with custom topic (no source-task topic))\n\n```es6\nconst { runSinkConnector, ConverterFactory } = require(\"glouc-pubsub-kafka-connect\");\n\nconst etlFunc = (messageValue, callback) =\u003e {\n\n    return callback(null, {\n        id: messageValue.payload.id,\n        name: messageValue.payload.name,\n        info: messageValue.payload.info\n    });\n};\n\nconst converter = ConverterFactory.createSinkSchemaConverter({}, etlFunc);\n\nrunSinkConnector(config, [converter], onError).then(config =\u003e {\n    //runs forever until: config.stop();\n});\n\n/*\n    this example would be able to store kafka message values\n    that look like this (so completely unrelated to messages created by a default SourceTask)\n    {\n        payload: {\n            id: 1,\n            name: \"first item\",\n            info: \"some info\"\n        },\n        type: \"publish\"\n    }\n*/\n```\n\n## Use CLI\nnote: in BETA :seedling:\n\n```\nnpm install -g gcloud-pubsub-kafka-connect\n```\n\n```\n# run source etl: pubsub -\u003e kafka\nnkc-pubsub-source --help\n```\n\n```\n# run sink etl: kafka -\u003e pubsub\nnkc-pubsub-sink --help\n```\n\n## Config(uration)\n```es6\nconst config = {\n    kafka: {\n        zkConStr: \"localhost:2181/\",\n        logger: null,\n        groupId: \"kc-pubsub-test\",\n        clientName: \"kc-pubsub-test-name\",\n        workerPerPartition: 1,\n        options: {\n            sessionTimeout: 8000,\n            protocol: [\"roundrobin\"],\n            fromOffset: \"earliest\", //latest\n            fetchMaxBytes: 1024 * 100,\n            fetchMinBytes: 1,\n            fetchMaxWaitMs: 10,\n            heartbeatInterval: 250,\n            retryMinTimeout: 250,\n            requireAcks: 1,\n            //ackTimeoutMs: 100,\n            //partitionerType: 3\n        }\n    },\n    topic: \"pubsub-test-topic\",\n    partitions: 1,\n    maxTasks: 1,\n    pollInterval: 2000,\n    produceKeyed: true,\n    produceCompressionType: 0,\n    connector: {\n        batchSize: 500,\n        maxPollCount: 500,\n        projectId: \"bq-project-id\",\n        subscription: \"ps_subscription\",\n        topic: \"ps_topic\",\n        idColumn: \"id\"\n    },\n    http: {\n        port: 3149,\n        middlewares: []\n    },\n    enableMetrics: true\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodefluent%2Fgcloud-pubsub-kafka-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodefluent%2Fgcloud-pubsub-kafka-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodefluent%2Fgcloud-pubsub-kafka-connect/lists"}