diff --git a/docs/streams/developer-guide/processor-api.html b/docs/streams/developer-guide/processor-api.html index 8236ded5c8274..e07efb16580c6 100644 --- a/docs/streams/developer-guide/processor-api.html +++ b/docs/streams/developer-guide/processor-api.html @@ -53,6 +53,7 @@
  • Connecting Processors and State Stores
  • +
  • Accessing Processor Context
  • @@ -351,6 +352,22 @@

    your store.

    +
    +

    Accessing Processor Context

    +

    As we have mentioned in Defining a Stream Processor<\href>, a ProcessorContext control the processing workflow, such as scheduling a punctuation function, and committing the current processed state.

    +

    This object can also be used to access the metadata related with the application like + applicationId, taskId, + and stateDir, and also record related metadata as topic, + partition, offset, timestamp and + headers.

    +

    Here is an example implementation of how to add a new header to the record:

    +
    public void process(String key, String value) {
    +            
    +            // add a heaeder to the elements
    +            context().headers().add.("key", "key"
    +            }
    +            
    +

    Connecting Processors and State Stores

    Now that a processor (WordCountProcessor) and the @@ -399,8 +416,8 @@

    Connecting Processors and State Stores

    Now that you have fully defined your processor topology in your application, you can proceed to running the Kafka Streams application.

    -

    -
    + +