Hi John, Guozhang,

No problem, I’ll keep an eye out for the change! Thanks for letting me know, I 
will give my change a try with your example.

Appreciate the quick reply!

Best,
Upesh


Upesh Desai | Senior Software Developer | ude...@itrsgroup.com
www.itrsgroup.com
From: John Roesler <j...@vvcephei.org>
Date: Saturday, February 6, 2021 at 8:22 PM
To: users@kafka.apache.org <users@kafka.apache.org>
Subject: Re: Kafka 2.7.0 processor API and streams-test-utils changes
Hello Upesh,

I’m sorry for the trouble. This was my feature, and my oversight. I will update 
the docs on Monday.

The quick answer is that there is also a new api.MockProcessorContext, which is 
compatible with the new interface. That class also provides 
getStateStoreContext to use with the state stores: 
https://kafka.apache.org/27/javadoc//org/apache/kafka/streams/processor/api/MockProcessorContext.html#getStateStoreContext--<https://kafka.apache.org/27/javadoc/org/apache/kafka/streams/processor/api/MockProcessorContext.html#getStateStoreContext-->

Here is an example of how to use it:

https://github.com/apache/kafka/blob/trunk/streams/test-utils/src/test/java/org/apache/kafka/streams/test/wordcount/WindowedWordCountProcessorTest.java#L57-L58

I hope this helps, and I’ll fix the docs ASAP.

Thanks,
John

On Fri, Feb 5, 2021, at 17:33, Guozhang Wang wrote:
> Hello Upesh,
>
> Thanks for the report! I think this is overlooked to update the
> documentation with the new 2.7.0 release. Could you file a JIRA (or even
> better, provide a PR with the JIRA :) to update the docs?
>
>
> Guozhang
>
> On Thu, Feb 4, 2021 at 1:03 PM Upesh Desai <ude...@itrsgroup.com> wrote:
>
> > Hello,
> >
> >
> >
> > I recently upgraded our Kafka components to 2.7.0, and noticed the changes
> > to the processor API. Specifically, the additions of:
> >
> >
> >
> >    - org.apache.kafka.streams.processor.api.Processor
> >    - org.apache.kafka.streams.processor.api.ProcessorContext
> >
> >
> >
> > The old Topology.addProcessor() method has been deprecated, which is what
> > led me to finding the new classes. After porting our code to the updated
> > processor API, we noticed issues with the Processor unit tests, which had
> > been written follow this documentation exactly:
> >
> >
> >
> >
> > https://kafka.apache.org/27/documentation/streams/developer-guide/testing.html#unit-testing-processors
> >
> >
> >
> > However, it seems that the MockProcessorContext and possibly other test
> > suite classes have not been updated for the new API changes, such as the
> > following methods:
> >
> >
> >
> > store.init(context, store);
> >
> > context.register(store, null);
> >
> >
> >
> > Can someone point me in the right direction if this has indeed been
> > changed/fixed or need to raise an issue to have this updated in the next
> > release?
> >
> >
> >
> > Cheers!
> > <https://www.itrsgroup.com/>
> > Upesh Desai​
> > Senior Software Developer
> > *ude...@itrsgroup.com* <ude...@itrsgroup.com>
> > *www.itrsgroup.com* <https://www.itrsgroup.com/>
> > Internet communications are not secure and therefore the ITRS Group does
> > not accept legal responsibility for the contents of this message. Any view
> > or opinions presented are solely those of the author and do not necessarily
> > represent those of the ITRS Group unless otherwise specifically stated.
> > [itrs.email.signature]
> >
> >
> > *Disclaimer*
> >
> > The information contained in this communication from the sender is
> > confidential. It is intended solely for use by the recipient and others
> > authorized to receive it. If you are not the recipient, you are hereby
> > notified that any disclosure, copying, distribution or taking action in
> > relation of the contents of this information is strictly prohibited and may
> > be unlawful.
> >
> > This email has been scanned for viruses and malware, and may have been
> > automatically archived by *Mimecast Ltd*, an innovator in Software as a
> > Service (SaaS) for business. Providing a *safer* and *more useful* place
> > for your human generated data. Specializing in; Security, archiving and
> > compliance.
> >
>
>
> --
> -- Guozhang
>

Disclaimer

The information contained in this communication from the sender is 
confidential. It is intended solely for use by the recipient and others 
authorized to receive it. If you are not the recipient, you are hereby notified 
that any disclosure, copying, distribution or taking action in relation of the 
contents of this information is strictly prohibited and may be unlawful.

This email has been scanned for viruses and malware, and may have been 
automatically archived by Mimecast Ltd, an innovator in Software as a Service 
(SaaS) for business. Providing a safer and more useful place for your human 
generated data. Specializing in; Security, archiving and compliance. To find 
out more visit the Mimecast website.

Reply via email to