If you have a partitioner that always return 0, produce requests will
always be routed to 1 broker. However, if that broker goes down, the
requests will be routed to another broker. This is because the producer
only route requests to live partitions.

Jun

On Wed, May 9, 2012 at 5:57 PM, xiaoyu wang <xiaoyu.w...@gmail.com> wrote:

> OK. I have the answer now. when I connect to brokers through zookeeper, the
> record may go to any broker and the partitioner is for partition on the
> broker.
>
> On Wed, May 9, 2012 at 5:48 PM, xiaoyu wang <xiaoyu.w...@gmail.com> wrote:
>
> > Thanks Jun.
> >
> > I think my question is if I have a program which produces a topic with a
> > partitioner that always returns 0, does all the messages go the same
> > broker? If so, what happens if I restart the program, does the messages
> > still go the same broker? Note that all the connections are through
> > zookeeper.
> >
> >
> > Thanks,
> >
> >
> >
> > On Tue, May 8, 2012 at 5:37 PM, Jun Rao <jun...@gmail.com> wrote:
> >
> >> Xiaoyu,
> >>
> >> A simpler way to do that is to send all produce requests to 1 broker and
> >> configure that broker to have 1 partition per topic.
> >>
> >> Jun
> >>
> >> On Tue, May 8, 2012 at 12:41 PM, xiaoyu wang <xiaoyu.w...@gmail.com>
> >> wrote:
> >>
> >> > Hello,
> >> >
> >> > I want to keep the order of record in my topic so I created the
> producer
> >> > with a partitioner that always returns 0. I have the following
> questions
> >> >
> >> >
> >> >   - will my topic be stored in 1 broker only?
> >> >   - If so, which broker does my topic go to?
> >> >   - what happens if I change the partitioner later to e.g. random
> >> >   partitoner?
> >> >
> >> >
> >> > Thanks,
> >> >
> >> > -Xiaoyu
> >> >
> >>
> >
> >
>

Reply via email to