{"id":13783376,"url":"https://github.com/Aiven-Open/gcs-connector-for-apache-kafka","last_synced_at":"2025-05-11T18:31:39.746Z","repository":{"id":38368365,"uuid":"179056074","full_name":"Aiven-Open/gcs-connector-for-apache-kafka","owner":"Aiven-Open","description":"Aiven's GCS Sink Connector for Apache Kafka®","archived":true,"fork":false,"pushed_at":"2024-08-27T10:40:59.000Z","size":1067,"stargazers_count":71,"open_issues_count":6,"forks_count":39,"subscribers_count":64,"default_branch":"main","last_synced_at":"2025-04-29T10:46:57.763Z","etag":null,"topics":["gcp","gcs","google-cloud-platform","google-cloud-storage","kafka","kafka-connect"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aiven-Open.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-02T10:41:44.000Z","updated_at":"2025-04-17T15:36:11.000Z","dependencies_parsed_at":"2023-07-26T11:16:00.928Z","dependency_job_id":"6269ac2a-5344-4f2c-a06f-551bb14652aa","html_url":"https://github.com/Aiven-Open/gcs-connector-for-apache-kafka","commit_stats":null,"previous_names":["aiven/aiven-kafka-connect-gcs","aiven-open/gcs-connector-for-apache-kafka","aiven/gcs-connector-for-apache-kafka"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aiven-Open%2Fgcs-connector-for-apache-kafka","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aiven-Open%2Fgcs-connector-for-apache-kafka/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aiven-Open%2Fgcs-connector-for-apache-kafka/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aiven-Open%2Fgcs-connector-for-apache-kafka/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aiven-Open","download_url":"https://codeload.github.com/Aiven-Open/gcs-connector-for-apache-kafka/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253613331,"owners_count":21936256,"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":["gcp","gcs","google-cloud-platform","google-cloud-storage","kafka","kafka-connect"],"created_at":"2024-08-03T19:00:19.995Z","updated_at":"2025-05-11T18:31:39.362Z","avatar_url":"https://github.com/Aiven-Open.png","language":"Java","funding_links":[],"categories":["Development"],"sub_categories":["Connectors"],"readme":"# Aiven's GCS Sink Connector for Apache Kafka®\n\n\u003e [!IMPORTANT]\n\u003e The Aiven GCS Connector for Apache Kafka development has been moved to https://github.com/Aiven-Open/commons-for-apache-kafka-connect/\n\n![Pull Request Workflow](https://github.com/aiven/gcs-connector-for-apache-kafka/workflows/Pull%20Request%20Workflow/badge.svg)\n\nThis is a sink\n[Apache Kafka Connect](https://kafka.apache.org/documentation/#connect)\nconnector that stores Kafka messages in a\n[Google Cloud Storage (GCS)](https://cloud.google.com/storage/) bucket.\n\nThe connector requires Java 11 or newer for development and production.\n\n## How It Works\n\nThe connector subscribes to the specified Kafka topics and collects\nmessages coming in them and periodically dumps the collected data to the\nspecified bucket in GCS.\n\nSometimes—for example, on reprocessing of some data—the connector will overwrite files that are already in the bucket. You need to ensure the bucket doesn't have a retention policy that prohibits overwriting.\n\nThe following object permissions must be enabled in the bucket:\n- `storage.objects.create`;\n- `storage.objects.delete` (needed for overwriting).\n\n### File name format\n\nThe connector uses the following format for output files (blobs):\n`\u003cprefix\u003e\u003cfilename\u003e`.\n\n`\u003cprefix\u003e` is the optional prefix that can be used, for example, for\nsubdirectories in the bucket.\n\n`\u003cfilename\u003e` is the file name. The connector has the configurable\ntemplate for file names. It supports placeholders with variable names:\n`{{ variable_name }}`. Currently, supported variables are:\n- `topic` - the Kafka topic;\n- `partition:padding=true|false` - the Kafka partition, if `padding` set to `true` it will set leading zeroes for offset, the default value is `false`;\n- `start_offset:padding=true|false` - the Kafka offset of the first record in the file, if `padding` set to `true` it will set leading zeroes for offset, the default value is `false`;\n- `timestamp:unit=yyyy|MM|dd|HH` - the timestamp of when the Kafka record has been processed by the connector.\n   - `unit` parameter values:\n     - `yyyy` - year, e.g. `2020` (please note that `YYYY` is deprecated and is interpreted as `yyyy`)\n     - `MM` - month, e.g. `03`\n     - `dd` - day, e.g. `01`\n     - `HH` - hour, e.g. `24`\n- `key` - the Kafka key.\n\nTo add zero padding to Kafka offsets, you need to add additional parameter `padding` in the `start_offset` variable,\nwhich value can be `true` or `false` (the default).\nFor example: `{{topic}}-{{partition}}-{{start_offset:padding=true}}.gz`\nwill produce file names like `mytopic-1-00000000000000000001.gz`.\n\nTo add zero padding to partition number, you need to add additional parameter `padding` in the `partition` variable,\nwhich value can be `true` or `false` (the default).\nFor example: `{{topic}}-{{partition:padding=true}}-{{start_offset}}.gz`\nwill produce file names like `mytopic-0000000001-1.gz`.\n\nTo add formatted timestamps, use `timestamp` variable.\u003cbr/\u003e\nFor example: `{{topic}}-{{partition}}-{{start_offset}}-{{timestamp:unit=yyyy}}{{timestamp:unit=MM}}{{timestamp:unit=dd}}.gz`\nwill produce file names like `mytopic-2-1-20200301.gz`.\n\nTo configure the time zone for the `timestamp` variable,\nuse `file.name.timestamp.timezone` property.\nPlease see the description of properties in the \"Configuration\" section.\n\nOnly the certain combinations of variables and parameters are allowed in the file name\ntemplate (however, variables in a template can be in any order). Each\ncombination determines the mode of record grouping the connector will\nuse. Currently, supported combinations of variables and the corresponding\nrecord grouping modes are:\n- `topic`, `partition`, `start_offset`, and `timestamp` - grouping by the topic,\n  partition, and timestamp;\n- `key` - grouping by the key.\n\nIf the file name template is not specified, the default value is\n`{{topic}}-{{partition}}-{{start_offset}}` (+ `.gz` when compression is\nenabled).\n\n### Record grouping\n\nIncoming records are being grouped until flushed.\n\n#### Grouping by the topic and partition\n\nIn this mode, the connector groups records by the topic and partition.\nWhen a file is written, an offset of the first record in it is added to\nits name.\n\nFor example, let's say the template is\n`{{topic}}-part{{partition}}-off{{start_offset}}`. If the connector\nreceives records like\n```\ntopic:topicB partition:0 offset:0\ntopic:topicA partition:0 offset:0\ntopic:topicA partition:0 offset:1\ntopic:topicB partition:0 offset:1\nflush\n```\n\nthere will be two files `topicA-part0-off0` and `topicB-part0-off0` with\ntwo records in each.\n\nEach `flush` produces a new set of files. For example:\n\n```\ntopic:topicA partition:0 offset:0\ntopic:topicA partition:0 offset:1\nflush\ntopic:topicA partition:0 offset:2\ntopic:topicA partition:0 offset:3\nflush\n```\n\nIn this case, there will be two files `topicA-part0-off0` and\n`topicA-part0-off2` with two records in each.\n\n#### Grouping by the key\n\nIn this mode, the connector groups records by the Kafka key. It always\nputs one record in a file, the latest record that arrived before a flush\nfor each key. Also, it overwrites files if later new records with the\nsame keys arrive.\n\nThis mode is good for maintaining the latest values per key as files on\nGCS.\n\nLet's say the template is `k{{key}}`. For example, when the following\nrecords arrive\n```\nkey:0 value:0\nkey:1 value:1\nkey:0 value:2\nkey:1 value:3\nflush\n```\n\nthere will be two files `k0` (containing value `2`) and `k1` (containing\nvalue `3`).\n\nAfter a flush, previously written files might be overwritten:\n```\nkey:0 value:0\nkey:1 value:1\nkey:0 value:2\nkey:1 value:3\nflush\nkey:0 value:4\nflush\n```\n\nIn this case, there will be two files `k0` (containing value `4`) and\n`k1` (containing value `3`).\n\n##### The string representation of a key\n\nThe connector in this mode uses the following algorithm to create the\nstring representation of a key:\n\n1. If `key` is `null`, the string value is `\"null\"` (i.e., string\n   literal `null`).\n2. If `key` schema type is `STRING`, it's used directly.\n3. Otherwise, Java `.toString()` is applied.\n\nIf keys of you records are strings, you may want to use\n`org.apache.kafka.connect.storage.StringConverter` as `key.converter`.\n\n##### Warning: Single key in different partitions\n\nThe `group by key` mode primarily targets scenarios where each key\nappears in one partition only. If the same key appears in multiple\npartitions the result may be unexpected.\n\nFor example:\n```\ntopic:topicA partition:0 key:x value:aaa\ntopic:topicA partition:1 key:x value:bbb\nflush\n```\nfile `kx` may contain `aaa` or `bbb`, i.e. the behavior is\nnon-deterministic.\n\n### Data format\n\nOutput files are text files that contain one record per line (i.e.,\nthey're separated by `\\n`) except `PARQUET` format\n\nThere are four types of data format available:\n - **[Default]** Flat structure, where field values are separated by comma (`csv`)\n\n    Configuration: ```format.output.type=csv```.\n    Also, this is the default if the property is not present in the configuration.\n\n - Complex structure, where file is in format of [JSON lines](https://jsonlines.org/).\n    It contains one record per line and each line is a valid JSON object(`jsonl`)\n\n    Configuration: ```format.output.type=jsonl```.\n\n - Complex structure, where file is a valid JSON array of record objects.\n\n     Configuration: ```format.output.type=json```.\n\n- Complex structure, where file is in Apache [Parquet](https://parquet.apache.org/documentation/latest/) file format.\n\n  Configuration: ```format.output.type=parquet```.\n\n- Complex structure, where file is in Apache [Avro Container File](https://avro.apache.org/docs/current/specification/#object-container-files) file format.\n\n  Configuration: ```format.output.type=avro```.\n\n\nThe connector can output the following fields from records into the\noutput: the key, the value, the timestamp, the offset and headers. (The set of\nthese output fields is configurable.) The field values are separated by comma.\n\nIt is possible to control the number of records to be put in a\nparticular output file by setting `file.max.records`. By default, it is\n`0`, which is interpreted as \"unlimited\".\n\n#### CSV Format example\n\nThe key and the value—if they're output—are stored as binaries encoded\nin [Base64](https://en.wikipedia.org/wiki/Base64).\n\nFor example, if we output `key,value,offset,timestamp`, a record line might look like:\n```\na2V5,TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQ=,1232155,1554210895\n```\n\nIt is possible to control the encoding of the `value` field by setting\n`format.output.fields.value.encoding` to `base64` or `none`.\n\nIf the key, the value or the timestamp is null, an empty string will be\noutput instead:\n\n```\n,,,1554210895\n```\n\n**NB!**\n\n - The `key.converter` property must be set to `org.apache.kafka.connect.converters.ByteArrayConverter`\nor `org.apache.kafka.connect.storage.StringConverter` for this data format.\n\n - The `value.converter` property must be set to `org.apache.kafka.connect.converters.ByteArrayConverter` for this data format.\n\n#### JSONL Format example\n\nFor example, if we output `key,value,offset,timestamp`, a record line might look like:\n\n```json\n{ \"key\": \"k1\", \"value\": \"v0\", \"offset\": 1232155, \"timestamp\":\"2020-01-01T00:00:01Z\" }\n```\n\nOR\n\n```json\n{ \"key\": \"user1\", \"value\": {\"name\": \"John\", \"address\": {\"city\": \"London\"}}, \"offset\": 1232155, \"timestamp\":\"2020-01-01T00:00:01Z\" }\n```\n\nIt is recommended to use\n- `org.apache.kafka.connect.storage.StringConverter`,\n- `org.apache.kafka.connect.json.JsonConverter`, or\n- `io.confluent.connect.avro.AvroConverter`.\n\nas `key.converter` and/or `value.converter` to make output files human-readable.\n\n**NB!**\n\n - The value of the `format.output.fields.value.encoding` property is ignored for this data format.\n - Value/Key schema will not be presented in output file, even if `value.converter.schemas.enable` property is `true`.\n But, it is still important to set this property correctly, so that connector could read records correctly.\n\n#### JSON Format example\n\nFor example, if we output `key,value,offset,timestamp`, an output file might look like:\n\n```json\n[\n{ \"key\": \"k1\", \"value\": \"v0\", \"offset\": 1232155, \"timestamp\":\"2020-01-01T00:00:01Z\" },\n{ \"key\": \"k2\", \"value\": \"v1\", \"offset\": 1232156, \"timestamp\":\"2020-01-01T00:00:05Z\" }\n]\n```\n\nOR\n\n```json\n[\n{ \"key\": \"user1\", \"value\": {\"name\": \"John\", \"address\": {\"city\": \"London\"}}, \"offset\": 1232155, \"timestamp\":\"2020-01-01T00:00:01Z\" }\n]\n```\n\nIt is recommended to use\n- `org.apache.kafka.connect.storage.StringConverter`,\n- `org.apache.kafka.connect.json.JsonConverter`, or\n- `io.confluent.connect.avro.AvroConverter`.\n\nas `key.converter` and/or `value.converter` to make output files human-readable.\n\n**NB!**\n\n - The value of the `format.output.fields.value.encoding` property is ignored for this data format.\n - Value/Key schema will not be presented in output file, even if `value.converter.schemas.enable` property is `true`.\n But, it is still important to set this property correctly, so that connector could read records correctly.\n\n##### NB!\n\nFor both JSON and JSONL another example could be for a single field output e.g. `value`, a record line might look like:\n\n```json\n{ \"value\": \"v0\" }\n```\n\nOR\n\n```json\n{ \"value\": {\"name\": \"John\", \"address\": {\"city\": \"London\"}} }\n```\n\nIn this case it sometimes make sense to get rid of additional JSON object wrapping the actual value using `format.output.envelope`.\nHaving `format.output.envelope=false` can produce the following output:\n\n```json\n\"v0\"\n```\n\nOR\n\n```json\n{\"name\": \"John\", \"address\": {\"city\": \"London\"}}\n```\n\n#### Parquet format example\n\nFor example, if we output `key,offset,timestamp,headers,value`, an output Parquet schema might look like this:\n```json\n{\n    \"type\": \"record\", \"fields\": [\n      {\"name\": \"key\", \"type\": \"RecordKeySchema\"},\n      {\"name\": \"offset\", \"type\": \"long\"},\n      {\"name\": \"timestamp\", \"type\": \"long\"},\n      {\"name\": \"headers\", \"type\": \"map\"},\n      {\"name\": \"value\", \"type\": \"RecordValueSchema\"}\n  ]\n}\n```\nwhere `RecordKeySchema` - a key schema and `RecordValueSchema` - a record value schema.\nThis means that in case you have the record and key schema like:\n\nKey schema:\n```json\n{\n  \"type\": \"string\"\n}\n```\n\nRecord schema:\n```json\n{\n    \"type\": \"record\", \"fields\": [\n      {\"name\": \"foo\", \"type\": \"string\"},\n      {\"name\": \"bar\", \"type\": \"long\"}\n  ]\n}\n```\nthe final `Avro` schema for `Parquet` is:\n```json\n{\n    \"type\": \"record\", \"fields\": [\n      {\"name\": \"key\", \"type\": \"string\"},\n      {\"name\": \"offset\", \"type\": \"long\"},\n      {\"name\": \"timestamp\", \"type\": \"long\"},\n      {\"name\": \"headers\", \"type\": \"map\", \"values\": \"long\"},\n      { \"name\": \"value\",\n        \"type\": \"record\",\n        \"fields\": [\n          {\"name\": \"foo\", \"type\": \"string\"},\n          {\"name\": \"bar\", \"type\": \"long\"}\n        ]\n      }\n  ]\n}\n```\n\n\nFor a single-field output e.g. `value`, a record line might look like:\n\n```json\n{ \"value\": {\"name\": \"John\", \"address\": {\"city\": \"London\"}} }\n```\n\nIn this case it sometimes make sense to get rid of additional JSON object wrapping the actual value using `format.output.envelope`.\nHaving `format.output.envelope=false` can produce the following output:\n\n```json\n{\"name\": \"John\", \"address\": {\"city\": \"London\"}}\n```\n\n**NB!**\n- The value of the `format.output.fields.value.encoding` property is ignored for this data format.\n- Due to Avro limitation message headers values must be the same datatype\n- If you use `org.apache.kafka.connect.json.JsonConverter` be sure that you message contains schema. E.g. possible `JSON` message:\n    ```json\n    {\n      \"schema\": {\n        \"type\": \"struct\",\n        \"fields\": [\n          {\"type\":\"string\", \"field\": \"name\"}\n        ]\n      }, \"payload\": {\"name\":  \"foo\"}\n    }\n    ```\n- Connector works just fine with and without Schema Registry\n- `format.output.envelope=false` is ignored if the value is not of type `org.apache.avro.Schema.Type.RECORD` or `org.apache.avro.Schema.Type.MAP`.\n\n#### Avro format example\n\nThe output file is an [Avro Object Container File](https://avro.apache.org/docs/current/specification/#object-container-files).\n\nFor example, if we output `key,offset,timestamp,headers,value`, an output Avro schema might look like this:\n```json\n{\n    \"type\": \"record\", \"fields\": [\n      {\"name\": \"key\", \"type\": \"RecordKeySchema\"},\n      {\"name\": \"offset\", \"type\": \"long\"},\n      {\"name\": \"timestamp\", \"type\": \"long\"},\n      {\"name\": \"headers\", \"type\": \"map\"},\n      {\"name\": \"value\", \"type\": \"RecordValueSchema\"}\n  ]\n}\n```\nwhere `RecordKeySchema` - a key schema and `RecordValueSchema` - a record value schema.\nThis means that in case you have the record and key schema like:\n\nKey schema:\n```json\n{\n  \"type\": \"string\"\n}\n```\n\nRecord schema:\n```json\n{\n    \"type\": \"record\", \"fields\": [\n      {\"name\": \"foo\", \"type\": \"string\"},\n      {\"name\": \"bar\", \"type\": \"long\"}\n  ]\n}\n```\nthe final `Avro` schema for output is:\n```json\n{\n    \"type\": \"record\", \"fields\": [\n      {\"name\": \"key\", \"type\": \"string\"},\n      {\"name\": \"offset\", \"type\": \"long\"},\n      {\"name\": \"timestamp\", \"type\": \"long\"},\n      {\"name\": \"headers\", \"type\": \"map\", \"values\": \"long\"},\n      { \"name\": \"value\",\n        \"type\": \"record\",\n        \"fields\": [\n          {\"name\": \"foo\", \"type\": \"string\"},\n          {\"name\": \"bar\", \"type\": \"long\"}\n        ]\n      }\n  ]\n}\n```\n\n\nFor a single-field output e.g. `value`, a record line might look like:\n\n```json\n{ \"value\": {\"name\": \"John\", \"address\": {\"city\": \"London\"}} }\n```\n\nIn this case it sometimes make sense to get rid of additional object wrapping the actual value using `format.output.envelope`.\nHaving `format.output.envelope=false` can produce the following output:\n\n```json\n{\"name\": \"John\", \"address\": {\"city\": \"London\"}}\n```\n\n**NB!**\n- The value of the `format.output.fields.value.encoding` property is ignored for this data format.\n- Due to Avro limitation message headers values must be the same datatype\n- Connector works just fine with and without Schema Registry\n- `format.output.envelope=false` is ignored if the value is not of type `org.apache.avro.Schema.Type.RECORD` or `org.apache.avro.Schema.Type.MAP`.\n- The Avro Object Container File requires that each value is written with the same schema in the file. When schema evolution happens for the input data, a new output file is created on every schema change. When data with previous and new schema is interleaved in the source topic multiple files will get generated in short duration.\n- The schema for output file is derived from the Connect Schema. The Connect Schema is derived from the input records Avro schema by using the Schema Registry.\n\n\n## Retry strategy configuration property\n\nThere are six configuration properties to configure retry strategy exist.\n\n### Apache Kafka connect retry strategy properties\n\n- `kafka.retry.backoff.ms` - The retry backoff in milliseconds. This config is used to notify Apache Kafka Connect to retry delivering a message batch or\n  performing recovery in case of transient exceptions. Maximum value is `24` hours.\n\n### Google Cloud Storage retry strategy\n- `gcs.retry.backoff.initial.delay.ms` - Initial retry delay in milliseconds.\n    This config controls the delay before the first retry.\n    Subsequent retries will use this value adjusted\n    according to the `gcs.retry.backoff.delay.multiplier`.\n    The default value is `1000 ms`.\n- `gcs.retry.backoff.delay.multiplier` - Retry delay multiplier.\n    This config controls the change in retry delay.\n    The retry delay of the previous call is multiplied by it to calculate\n    the retry delay for the next call. The default value is `2.0`.\n- `gcs.retry.backoff.max.delay.ms` - Maximum retry delay in milliseconds.\n    This config puts a limit on the value of the retry delay,\n    so that the `gcs.retry.backoff.delay.multiplier` value\n    can't increase the retry delay higher than this amount.\n    The default value is `32 000` ms.\n- `gcs.retry.backoff.total.timeout.ms` - Retry total timeout in milliseconds.\n    This config controls over how long the logic should keep trying the\n    remote call until it gives up completely. The default value is `50 000` ms.\n    The maximum value is `24` hours.\n- `gcs.retry.backoff.max.attempts` - Retry max attempts.\n  This config defines the maximum number of attempts to perform.\n  The default value is `6`.\n\n## Configuration\n\n[Here](https://kafka.apache.org/documentation/#connect_running) you can\nread about the Connect workers configuration and\n[here](https://kafka.apache.org/documentation/#connect_resuming), about\nthe connector Configuration.\n\nHere is an example connector configuration with descriptions:\n\n```properties\n### Standard connector configuration\n\n## Fill in your values in these:\n\n# Unique name for the connector.\n# Attempting to register again with the same name will fail.\nname=my-gcs-connector\n\n## These must have exactly these values:\n\n# The Java class for the connector\nconnector.class=io.aiven.kafka.connect.gcs.GcsSinkConnector\n\n# The key converter for this connector\nkey.converter=org.apache.kafka.connect.storage.StringConverter\n\n# The value converter for this connector\nvalue.converter=org.apache.kafka.connect.json.JsonConverter\n\n# Identify, if value contains a schema.\n# Required value converter is `org.apache.kafka.connect.json.JsonConverter`.\nvalue.converter.schemas.enable=false\n\n# The type of data format used to write data to the GCS output files.\n# The supported values are: `csv`, `json`, `jsonl` and `parquet`.\n# Optional, the default is `csv`.\nformat.output.type=jsonl\n\n# A comma-separated list of topics to use as input for this connector\n# Also a regular expression version `topics.regex` is supported.\n# See https://kafka.apache.org/documentation/#connect_configuring\ntopics=topic1,topic2\n\n### Connector-specific configuration\n### Fill in you values\n\n# The name of the GCS bucket to use\n# Required.\ngcs.bucket.name=my-gcs-bucket\n\n## The following three options are used to specify GCP credentials.\n## See the overview of GCP authentication:\n##  - https://cloud.google.com/docs/authentication/\n##  - https://cloud.google.com/docs/authentication/production\n## If none are present, the connector will default to trying to connect without credentials.\n## If only one is present, the connector will use it to get the credentials.\n## If more than one is present, this is an error.\n\n# The path to a GCP credentials file.\n# Optional, the default is null.\ngcs.credentials.path=/some/path/google_credentials.json\n\n# GCP credentials as a JSON object.\n# Optional, the default is null.\ngcs.credentials.json={\"type\":\"...\", ...}\n\n# Autodiscover GCP Credentials from the execution environment\ngcs.credentials.default=true\n##\n\n# The value of object metadata Content-Encoding.\n# This can be used for leveraging storage-side de-compression before download.\n# Optional, the default is null.\ngcs.object.content.encoding=gzip\n\n# The set of the fields that are to be output, comma separated.\n# Supported values are: `key`, `value`, `offset`, `timestamp`, and `headers`.\n# Optional, the default is `value`.\nformat.output.fields=key,value,offset,timestamp,headers\n\n# The option to enable/disable wrapping of plain values into additional JSON object(aka envelope)\n# Optional, the default value is `true`.\nformat.output.envelope=true\n\n# The prefix to be added to the name of each file put on GCS.\n# See the GCS naming requirements https://cloud.google.com/storage/docs/naming\n# Optional, the default is empty.\nfile.name.prefix=some-prefix/\n\n# The compression type used for files put on GCS.\n# The supported values are: `gzip`, `snappy`, `zstd`, `none`.\n# Optional, the default is `none`.\nfile.compression.type=gzip\n\n# The compression used for Avro Container File blocks.\n# The supported values are: `bzip2`, `deflate`, `null`, `snappy`, `zstandard`.\n# Optional, the default is `null`.\navro.codec=null\n\n# The time zone in which timestamps are represented.\n# Accepts short and long standard names like: `UTC`, `PST`, `ECT`,\n# `Europe/Berlin`, `Europe/Helsinki`, or `America/New_York`.\n# For more information please refer to https://docs.oracle.com/javase/tutorial/datetime/iso/timezones.html.\n# The default is `UTC`.\nfile.name.timestamp.timezone=Europe/Berlin\n\n# The source of timestamps.\n# Supports only `wallclock` which is the default value.\nfile.name.timestamp.source=wallclock\n\n# The file name template.\n# See \"File name format\" section.\n# Optional, the default is `{{topic}}-{{partition:padding=false}}-{{start_offset:padding=false}}` or\n# `{{topic}}-{{partition:padding=false}}-{{start_offset:padding=false}}.gz` if the compression is enabled.\nfile.name.template={{topic}}-{{partition:padding=true}}-{{start_offset:padding=true}}.gz\n```\n\n## Getting releases\n\nThe connector releases are available in the Releases section.\n\nRelease JARs are available in Maven Central:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.aiven\u003c/groupId\u003e\n  \u003cartifactId\u003egcs-connector-for-apache-kafka\u003c/artifactId\u003e\n  \u003cversion\u003ex.y.z\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Development\n\n### Developing together with Common Module for Apache Kafka Connect library\n\nThis project depends on [Common Module for Apache Kafka Connect](https://github.com/aiven/commons-for-apache-kafka-connect). Normally, an artifact from a globally accessible repository is used. However, if you need to introduce changes to both this connector and Common Module for Apache Kafka Connect library at the same time, you should short-circuit the development loop via locally published artifacts. Please follow these steps:\n1. Checkout the `main` `HEAD` of Common Module for Apache Kafka Connect.\n2. Ensure the version [here](https://github.com/aiven/commons-for-apache-kafka-connect/blob/main/gradle.properties) is with `-SNAPSHOT` prefix.\n3. Make changes to Common Module for Apache Kafka Connect.\n4. Publish it locally with `./gradlew publishToMavenLocal`.\n5. Change the version in the connector's [`build.gradle`](build.gradle) (`ext.aivenConnectCommonsVersion`) to match the published snapshot version of Common Module for Apache Kafka Connect.\n\nAfter that, the latest changes you've done to Common Module for Apache Kafka Connect will be used.\n\nWhen you finish developing the feature and is sure Common Module for Apacha Kafka Connect won't need to change:\n1. Make a proper release of Common Module for Apache Kafka Connect.\n2. Publish the artifact to the currently used globally accessible repository.\n3. Change the version of Common Module for Apache Kafka Connect in the connector to the published one.\n\n### Integration testing\n\nIntegration tests are implemented using JUnit, Gradle and Docker.\n\nTo run them, you need:\n- a GCS bucket with the read-write permissions;\n- Docker installed.\n\nIn order to run the integration tests, execute from the project root\ndirectory:\n\n```bash\n./gradlew clean integrationTest -PtestGcsBucket=test-bucket-name\n```\n\nwhere `PtestGcsBucket` is the name of the GCS bucket to use.\n\nThe default GCP credentials will be used during the test (see [the GCP\ndocumentation](https://cloud.google.com/docs/authentication/getting-started)\nand\n[the comment in GCP SDK code](https://github.com/googleapis/google-auth-library-java/blob/6698b3f6b5ab6017e28f68971406ca765807e169/oauth2_http/java/com/google/auth/oauth2/GoogleCredentials.java#L68)).\nThis can be overridden either by setting the path to the GCP credentials\nfile or by setting the credentials JSON string explicitly. (See\n[Configuration section](#configuration) for details).\n\nTo specify the GCS credentials path, use `gcsCredentialsPath` property:\n\n```bash\n./gradlew clean integrationTest -PtestGcsBucket=test-bucket-name \\\n    -PgcsCredentialsPath=/path/to/credentials.json\n```\n\nTo specify the GCS credentials JSON, use `gcsCredentialsJson` property:\n\n```bash\n./gradlew clean integrationTest -PtestGcsBucket=test-bucket-name \\\n    -PgcsCredentialsJson='{type\":\"...\", ...}'\n```\n\nGradle allows setting properties using environment variables, for\nexample, `ORG_GRADLE_PROJECT_testGcsBucket=test-bucket-name`. See more\nabout the ways to set properties\n[here](https://docs.gradle.org/current/userguide/build_environment.html#sec:project_properties).\n\n### Releasing\n\nTBD\n\n## License\n\nThis project is licensed under the [Apache License, Version 2.0](LICENSE).\n\n## Trademarks\n\nApache Kafka, Apache Kafka Connect are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries. Google Cloud Storage (GCS) is a trademark and property of their respective owners. All product and service names used in this website are for identification purposes only and do not imply endorsement.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAiven-Open%2Fgcs-connector-for-apache-kafka","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAiven-Open%2Fgcs-connector-for-apache-kafka","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAiven-Open%2Fgcs-connector-for-apache-kafka/lists"}