anchor.diff:  
   toc::[]
   
  -[NOTE]
  -====
  -This SMT is currently in incubating state, i.e. exact semantics, configuration options etc. may change in future revisions, based on the feedback we receive. Please let us know if you encounter any problems while using this routing transformation.
  -====
  +By default, {prodname} streams all of the change events that it reads from a table to a single static topic.
  +However, there might be situations in which you might want to reroute selected events to other topics, based on the event content.
  +The process of routing messages based on their content is described in the https://www.enterpriseintegrationpatterns.com/patterns/messaging/ContentBasedRouter.html[Content-based routing] messaging pattern. 
  +To apply this pattern in {prodname}, you use the content-based routing SMT to write expressions that are evaluated for each event.
  +Depending how an event is evaluated, the SMT either routes the event message to the original destination topic, or reroutes it to the topic that you specify in the expression.
   
  -With real-life applications, it is often necessary to route the events not only to a static topic but to a topic based on the message content.
  -This is expressed as the https://www.enterpriseintegrationpatterns.com/patterns/messaging/ContentBasedRouter.html[Content-Based Router] integration pattern.
  -Kafka Connect provides a generic mechanism to do the routing in the form of link:https://cwiki.apache.org/confluence/display/KAFKA/KIP-66%3A+Single+Message+Transforms+for+Kafka+Connect[Simple Message Transforms] (SMT).
  +Kafka Connect provides its own link:https://cwiki.apache.org/confluence/display/KAFKA/KIP-66%3A+Single+Message+Transforms+for+Kafka+Connect[Simple Message Transforms] (SMT) to encode routing logic.
  +However, the following drawbacks apply to using the generic SMT:
   
  -The SMT is a Java class that encodes the routing logic.
  -This is a very powerful mechanism but has two drawbacks:
  -
  -* It is necessary to compile the transformation upfront and deploy it to Kafka Connect.
  +* It is necessary to compile the transformation up front and deploy it to Kafka Connect.
   * Every change needs code recompilation and redeployment, leading to inflexible operations.
   
  -To solve this problem, {prodname} comes with the Content-Based Router SMT.
  -This SMT allows the operator to write an expression that is evaluated for each event and according to the result, it is either kept in the original topic or re-routed to another one.
  -The current implementation supports any scripting language which integrates with https://jcp.org/en/jsr/detail?id=223[JSR 223] (Scripting for the Java(TM) Platform).
  +The content-based routing SMT supports scripting languages that integrate with https://jcp.org/en/jsr/detail?id=223[JSR 223] (Scripting for the Java(TM) Platform).
   
  -The Content-Based Router SMT can be used like so:
  +// Type: concept
  +// ModuleID: example-of-configuring-content-based-routing-conditions
  +// Title: Example of configuring content-based routing conditions 
  +== Example
  +
  +To route change event records to topics based on their content, configure the content-based routing transformation in the Kafka Connect configuration for the {prodname} connector.
  +Configuration of the content-based routing SMT requires you to specify a regular expression to define routing criteria. 
  +
  +For example, you might add the following configuration to your connector configuration:
   
   [source]
   ----
  
positive.code: 
  |[[content-based-router-topic-regex]]<<content-based-router-topic-regex, `topic.regex`>>
  |
  |An optional regular expression for specifying the topic(s) this transformation should be applied to. Records on any topic whose name does not match the given expression are passed on as-is.
  
  |[[content-based-router-language]]<<content-based-router-language, `language`>>
  |
  |The language in which the expression is written. Must begin with `jsr223.`, e.g. `jsr223.groovy`, or `jsr223.graal.js`. Currently, only bootstrapping via the https://jcp.org/en/jsr/detail?id=223[JSR 223 API] ("Scripting for the Java (TM) Platform") is supported.
  
  |[[content-based-router-topic-expression]]<<content-based-router-topic-expression, `topic.expression`>>
  |
  |The expression evaluated for every message. Must evaluate to a `String` value where a result of non-null will re-route the message to a new topic, and a `null` value will keep it in the original topic.
  
  |[[content-based-router-null-handling-mode]]<<content-based-router-null-handling-mode, `null.handling.mode`>>
  |`keep`
  |Prescribes how the transformation should handle `null` (tombstone) messages. The options are: `keep` (the default) to pass the message through, `drop` to remove the messages completely, or `evaluate` to run the message through the topic expression.
  
  |===
  
negative.code: // Category: debezium-using
  // Type: assembly
  // ModuleID: routing-change-event-records-to-topics-according-to-event-content
  // Title: Routing change event records to topics according to event content
  [id="content-based-routing"]
  = Content-based routing
  
  :toc:
  :toc-placement: macro
  