On Mon, Mar 6, 2023 at 6:24 PM Kai Levy <kl...@toasttab.com> wrote:

> I agree, adding it to the ConsumerStats interface makes more logical sense,
> but I believe the implementation will be harder that way, since the
> producers are lazily initialized. They won't be available when
> ConsumerStats is created, and there isn't currently a way to access them
> directly from the consumer.
>
>
In `ConsumerImp` you have

private volatile Producer<byte[]> retryLetterProducer;

You can just add setRetryLetterProducer on `ConsumerStatsRecorder`



Kai
>
> On Sun, Mar 5, 2023 at 5:19 AM Asaf Mesika <asaf.mes...@gmail.com> wrote:
>
> > I would rather see them as attributes of ConsumerStats .
> > Add
> >
> > ProducerStats deadLetterProducerStats;
> >
> > ProducerStats retryLetterProducerStats();
> >
> >
> > On Fri, Mar 3, 2023 at 2:54 AM Kai Levy <kl...@toasttab.com> wrote:
> >
> > > Hello!
> > >
> > > I created a new PIP because I discovered there's no way for a user to
> > > access the metrics for a consumer's deadLetterProducer /
> > > retryLetterProducer, since it is private to ConsumerImpl.java. I would
> > like
> > > to propose an API change that would expose those statistics. More
> details
> > > on the github issue:
> > > https://github.com/apache/pulsar/issues/19698
> > >
> > > Thanks!
> > > Kai
> > >
> >
>

Reply via email to