Giter Club home page Giter Club logo

kflow's People

Contributors

k32 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

doytsujin k32

kflow's Issues

Should kflow handle adding partition to a topic?

Hello!

I setup a minimal kflow server using this kflow_config module:

-module(kflow_config).

-export([pipes/0]).

pipes() ->
  [bar()].

bar() ->
  PipeSpec = [{map, fun(_Offset, Msg) ->
                        io:format("~p ~p:~p bar Msg: '~p'~n", [calendar:local_time(), ?MODULE, ?LINE, Msg]),
                        {ok, Msg}
                    end},
              {map, fun(_Offset, Msg2) ->
                        io:format("~p ~p:~p Msg2: '~p'~n", [calendar:local_time(), ?MODULE, ?LINE, Msg2]),
                        {ok, Msg2}
                    end}
             ],
  #{ start => {kflow_kafka_consumer_v2, start_link}
   , args  => #{ group_id  => <<"foo_group">>
               , topics    => [<<"foobar">>]
               , id        => ?FUNCTION_NAME
               , pipe_spec => PipeSpec
               , auto_commit => false
               }
   }.

First I create a topic with two partitions:

kafka-topics --create --topic foobar --partitions 2 -replication-factor 1  --bootstrap-server localhost:9091

Then produce some messages using brod:

brod:produce_sync(brod_client_1, <<"foobar">>, 1, <<"">>, <<"test1 from brod">>).
brod:produce_sync(brod_client_1, <<"foobar">>, 0, <<"">>, <<"test0 from brod">>).

The messages are printed on the kflow side:

{{2021,1,20},{18,5,50}} kflow_config:44 bar Msg: '#{headers => [],key => <<>>,
                                                    partition => 1,
                                                    value =>
                                                        <<"test1 from brod">>}'
{{2021,1,20},{18,5,50}} kflow_config:50 Msg2: '{ok,
                                                #{headers => [],key => <<>>,
                                                  partition => 1,
                                                  value =>
                                                   <<"test1 from brod">>}}'
{{2021,1,20},{18,5,59}} kflow_config:44 bar Msg: '#{headers => [],key => <<>>,
                                                    partition => 0,
                                                    value =>
                                                        <<"test0 from brod">>}'
{{2021,1,20},{18,5,59}} kflow_config:50 Msg2: '{ok,
                                                #{headers => [],key => <<>>,
                                                  partition => 0,
                                                  value =>
                                                   <<"test0 from brod">>}}'

Everything works great. Then I add a new partition to the topic:

kafka-topics --alter --topic foobar --partitions 3 --bootstrap-server localhost:9091

and try to send a message into this new partition:

brod:produce_sync(brod_client_1, <<"foobar">>, 2, <<"what is it">>, <<"test2 from brod">>).

Unfortunately this message is not received on the kflow side. Is it supposed to work at all or am I trying something that's not supported (or even doesn't make sense)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.