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][Proposal-2] Support including the topic name to the metadata(#836) #862

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

RobertIndie
Copy link
Member

@RobertIndie RobertIndie commented Jan 15, 2024

Proposal link: #860

Special release for #816

See #816

  • Add new configuration includeTopicToMetadata

(cherry picked from commit 94620e4)

Motivation

Currently, we don't include the topic name to the metadata. And there is not intuitive workaround for it.

This proposal introduces a new configuration includeTopicName to the Cloud Storage sink connector. When
activated(true), the connector will include the topic name to the metadata in the sink file.

Modifications

Introduce a new configuration includeTopicToMetadata to support including the Pulsar topic name into the metadata.

The new data format of the cloud storage format would be like:

{
  "key": "value",
  "__message_metadata__": {
    "messageId": "CAgQADAA",
    "topic": "persistent://public/default/test-s3",
    "properties": {}
  }
}

A new key, topic, would be added to the metadata, containing the Pulsar topic name.

Tests

{"test-message":"test-value","__message_metadata__":{"messageId":"17:0:-1","topic":"persistent://public/default/test-s3","properties":{}}}
{"test-message":"test-value","__message_metadata__":{"messageId":"17:1:-1","topic":"persistent://public/default/test-s3","properties":{}}}
{"test-message":"test-value","__message_metadata__":{"messageId":"17:2:-1","topic":"persistent://public/default/test-s3","properties":{}}}
{"test-message":"test-value","__message_metadata__":{"messageId":"17:3:-1","topic":"persistent://public/default/test-s3","properties":{}}}
{"test-message":"test-value","__message_metadata__":{"messageId":"17:4:-1","topic":"persistent://public/default/test-s3","properties":{}}}
{"test-message":"test-value","__message_metadata__":{"messageId":"17:5:-1","topic":"persistent://public/default/test-s3","properties":{}}}
{"test-message":"test-value","__message_metadata__":{"messageId":"17:6:-1","topic":"persistent://public/default/test-s3","properties":{}}}
{"test-message":"test-value","__message_metadata__":{"messageId":"17:7:-1","topic":"persistent://public/default/test-s3","properties":{}}}
{"test-message":"test-value","__message_metadata__":{"messageId":"17:8:-1","topic":"persistent://public/default/test-s3","properties":{}}}
{"test-message":"test-value","__message_metadata__":{"messageId":"17:9:-1","topic":"persistent://public/default/test-s3","properties":{}}}

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Documentation

Check the box below.

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

Special release for #816

See #816

- Add new configuration `includeTopicToMetadata`

(cherry picked from commit 94620e4)
@RobertIndie RobertIndie self-assigned this Jan 15, 2024
@RobertIndie RobertIndie requested a review from a team as a code owner January 15, 2024 08:11
Copy link

@RobertIndie:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@github-actions github-actions bot added doc-info-missing This pr needs to mark a document option in description and removed doc-info-missing This pr needs to mark a document option in description labels Jan 15, 2024
Copy link

@RobertIndie:Thanks for providing doc info!

@github-actions github-actions bot added the doc-required This pr needs a document label Jan 15, 2024
@RobertIndie RobertIndie added release/3.1.2.2 and removed doc-required This pr needs a document labels Jan 15, 2024
Copy link

@RobertIndie:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@github-actions github-actions bot added the doc-info-missing This pr needs to mark a document option in description label Jan 15, 2024
@RobertIndie RobertIndie merged commit b2b28dd into master Jan 16, 2024
7 checks passed
@RobertIndie RobertIndie deleted the impl-proposal-2 branch January 16, 2024 00:39
RobertIndie added a commit that referenced this pull request Jan 16, 2024
RobertIndie added a commit that referenced this pull request Jan 16, 2024
) (#862)

### Motivation

Currently, we don't include the topic name to the metadata. And there is not intuitive workaround for it.

This proposal introduces a new configuration `includeTopicName` to the Cloud Storage sink connector. When
activated(`true`), the connector will include the topic name to the metadata in the sink file.

### Modifications

Introduce a new configuration `includeTopicToMetadata` to support including the Pulsar topic name into the metadata.

The new data format of the cloud storage format would be like:

```json
{
  "key": "value",
  "__message_metadata__": {
    "messageId": "CAgQADAA",
    "topic": "persistent://public/default/test-s3",
    "properties": {}
  }
}
```

A new key, `topic`, would be added to the metadata, containing the Pulsar topic name.

(cherry picked from commit b2b28dd)
RobertIndie added a commit that referenced this pull request Jan 16, 2024
### Motivation

Add doc for #862

(cherry picked from commit 0e7c1e8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-3.1 doc-info-missing This pr needs to mark a document option in description release/3.1.2.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants