GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Introduce pulsar-replicator and kinesis-provider with pulsar-function by rdhabalia · Pull Request #1594 · apache/pulsar

Conversation

@rdhabalia

@rdhabalia rdhabalia commented Apr 17, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Motivation

Addressing : #1582

Pulsar already supports geo-replication that persists messages across multiple clusters of pulsar instances. Therefore, client can set replication clusters for a topic, and pulsar broker internally takes care of replication to all the clusters. However, sometimes application may want to replicate the same published messages to other external systems which is not part of pulsar-eco system such as AWS-Kinesis, DynamoDB. Therefore, right now, client-application has to take this extra burden to publish same messages for pulsar and other external systems.
Therefore, it will be useful to introduce server side replication that can replicate pulsar messages to external system without client intervention. Also server side replication should be extensible which can provide a plugin mechanism to add various replicators to support message-replication to different external systems.

Requirement

  • Replicate Pulsar message to external system (eg: Kinesis, Kafka, another Pulsar cluster)
  • Easy onboarding: client should be able to add replicator configuration with CLI/Admin api and it should auto start appropriate replicators.
  • Isolation from core message bus
  • Pluggable framework and extensible to support multiple external system
  • New connectors should be developed with minimal efforts
  • Operability and monitoring
    • API to control start and stop individual replicator
    • API to get replicator stats
  • Security
    • Replicator framework should provide pluggable mechanism to plugin KeyStore implementation that can store and fetch client’s credentials which will be required to connect external system.

Note: will add stats-api and auto-replicator start in separate PR.

PIP:
https://github.com/apache/incubator-pulsar/wiki/PIP-18:-Pulsar-Replicator

Testing commands:

(1) Enable threadContainerFactory
/conf/functions_worker.yml

threadContainerFactory:
  threadGroupName: "Thread Function Container Group"
#processContainerFactory:
#  logDirectory:

(2) Start pulsar: ./pulsar standalone

(3) Create a namespace:
./pulsar-admin namespaces create sample/global/replicator

(4) Set clusters
./pulsar-admin namespaces set-clusters sample/global/replicator -c standalone

(5) add replicator properties

./pulsar-admin namespaces add-replicator sample/global/replicator \
    --replicator Kinesis \
    --region-name "us-west" \
    --topic-map \{\"pulsarTopic\":\"stream:us-west-2\",\"pulsarTopic2\":\"stream2:us-west-2\"} \
    --auth-param-data \{\"accessKey\":\"a1\",\"secretKey\":\"s1\"} \
    --auth-plugin-name org.apache.pulsar.replicator.auth.DefaultAuthParamKeyStore 

(6) Register a replicator
./pulsar-admin persistent register-replicator -r Kinesis --region-name "us-west" persistent://sample/global/replicator/pulsarTopic

(7) Publish messages

./pulsar-client produce persistent://sample/global/replicator/pulsarTopic -m 1 -n 10
./pulsar-admin persistent stats-internal persistent://sample/global/replicator/pulsarTopic | less

(8) Stop replicator
./pulsar-admin persistent update-replicator -r Kinesis --region-name "us-west" -a Stop persistent://sample/global/replicator/pulsarTopic

(9) start
./pulsar-admin persistent update-replicator -r Kinesis --region-name "us-west" -a Start persistent://sample/global/replicator/pulsarTopic

(10) Deregister replicator: Deletes replicator
./pulsar-admin persistent deregister-replicator -r Kinesis --region-name "us-west" persistent://sample/global/replicator/pulsarTopic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rdhabalia
Introduce pulsar-replicator and kinesis-provider with pulsar-function
2c9e499
@rdhabalia rdhabalia added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages type/feature The PR added a new feature or issue requested a new feature labels Apr 17, 2018
@rdhabalia rdhabalia added this to the 2.0.0-incubating milestone Apr 17, 2018
@rdhabalia rdhabalia self-assigned this Apr 17, 2018
aahmed-se
aahmed-se reviewed Apr 17, 2018
View reviewed changes

@aahmed-se aahmed-se left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be split between the pulsar function api changes and kinesis specific connector code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jerrypeng

jerrypeng commented Apr 17, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

@rdhabalia thanks for working on this. This is an awesome feature! Just a overall comments:

This is a very large PR. Perhaps we can break this up into multiple PRs to make reviewing easier?

Also, we are working on a connector framework for Pulsar that will run on top of functions:

https://github.com/apache/incubator-pulsar/tree/master/pulsar-connect/core/src/main/java/org/apache/pulsar/connect/core

I working on running the connectors on top of functions. Perhaps the replicator framework can use the connector framework as well so we don't duplicate efforts

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rdhabalia

rdhabalia commented Apr 17, 2018

Copy link
Copy Markdown
Contributor Author

This is a very large PR. Perhaps we can break this up into multiple PRs to make reviewing easier?

actually, kinesis provider code is relatively very small but it adds more context with replicator framework interface so, I kept it together. I am going to add stats-api, non-persistent topic support, auto-registration in separate PRs for better review.

Perhaps the replicator framework can use the connector framework as well so we don't duplicate efforts

Sure. In Yahoo, we need exactly like a replicator framework with which we can get granular control for operability and right now, immediately we need it for kinesis. So, we can definitely enhance replicator with other connector usecases.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Apr 22, 2018
Avoid creating different message object for pulsar sink connector #1632
Closed
Introduce pulsar replicator #1582
Closed
lucperkins
lucperkins reviewed Apr 24, 2018
View reviewed changes
Comment thread ...iders/provider/src/main/java/org/apache/pulsar/replicator/auth/AuthParamKeyStoreFactory.java

public class AuthParamKeyStoreFactory {

private static final Map<String, AuthParamKeyStore> authParamKeyStoreInstanceMap = Maps.newHashMap();

@lucperkins lucperkins Apr 24, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation on this file seems to be set to 8 rather than 4 (this is true of a few other files as well)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sijie

sijie commented Apr 25, 2018

Copy link
Copy Markdown
Member

@rdhabalia - since we are close to 2.0 release, shall we move this PR to 2.1?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rdhabalia

rdhabalia commented Apr 25, 2018

Copy link
Copy Markdown
Contributor Author

since we are close to 2.0 release, shall we move this PR to 2.1?

Sure, we can move it to next release and unblock 2.0.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sijie sijie modified the milestones: 2.0.0-incubating, 2.1.0-incubating Apr 25, 2018
@sijie

sijie commented Apr 25, 2018

Copy link
Copy Markdown
Member

@rdhabalia thank you

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sijie

sijie commented Jun 18, 2018

Copy link
Copy Markdown
Member

@rdhabalia if I understand, we don't need this PR anymore, right?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rdhabalia rdhabalia closed this Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aahmed-se aahmed-se aahmed-se left review comments
+1 more reviewer
@lucperkins lucperkins lucperkins left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@rdhabalia rdhabalia

Labels

type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages type/feature The PR added a new feature or issue requested a new feature

Projects

None yet

Milestone

2.1.0-incubating

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@rdhabalia @jerrypeng @sijie @lucperkins @aahmed-se
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.