Git Product home page Git Product logo

Comments (7)

guozhangwang avatar guozhangwang commented on July 17, 2024

@viktorjucas Yes, note that ProcessorContex#schedule returns a Cancellable event. You can cancel it even within the punctuate call. For example:

Cancellable scheduled;
scheduled = context.schedule(... timestamp -> scheduled.cancel);

from kafka-streams-examples.

viktorjucas avatar viktorjucas commented on July 17, 2024

I have tried that and it doesn't seem to be cancelling.

public class Transformer implements Transformer<> {
    private ProcessorContext context;
    private Cancellable scheduled;

    @Override
    public void init(PorcessorContext processContext) {
        this.context = processorContext;
        scheduled = context.schedule(TimeUnit.SECONDS.toMillis(5), PunctuationType.WALL_CLOCK_TIME,
                                     this::punctuateCancel);
    }

    private void punctuateCancel(long timestamp) {
        scheduled.cancel();
    }
}

from kafka-streams-examples.

guozhangwang avatar guozhangwang commented on July 17, 2024

Which version are you using? Note that this functionality is fixed in 1.1.1: https://issues.apache.org/jira/browse/KAFKA-6748

from kafka-streams-examples.

viktorjucas avatar viktorjucas commented on July 17, 2024

That's the reason. I was using 1.1.0.

from kafka-streams-examples.

viktorjucas avatar viktorjucas commented on July 17, 2024

Closed prematurely.

Is v1.1.1 available through Maven already?

from kafka-streams-examples.

guozhangwang avatar guozhangwang commented on July 17, 2024

No it is not released out yet: https://mvnrepository.com/artifact/org.apache.kafka/kafka-streams

If you have to cancel the even within the punctuate call, you can consider backporting that fix into your source code build.

from kafka-streams-examples.

mjsax avatar mjsax commented on July 17, 2024

@viktorjucas Kafka 1.1.1 is released now. Can you try it out and verify the fix so we can close this issue?

from kafka-streams-examples.

Related Issues (20)

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.