anchor.diff:  [[TypeConverter-Addtypeconverterclassesatruntime]]
   === Add type converter classes at runtime
   
  -You can add new type converters at runtime, by having your classes
  -implement `org.apache.camel.TypeConverters` which is an marker
  -interface. Then for each type converter you want use
  -the `@Converter` annotation.
  +Classes implementing https://www.javadoc.io/doc/org.apache.camel/camel-api/latest/org/apache/camel/TypeConverters.html[`TypeConverters`] are added to the type converter registry
  +at runtime. Use https://javadoc.io/doc/org.apache.camel/camel-api/latest/org/apache/camel/Converter.html[`@Converter`] to mark each type converter.
   
   [source,java]
   ----
  
positive.code: https://www.javadoc.io/doc/org.apache.camel/camel-api/current/org/apache/camel/CamelContext.html[CamelContext].
  
  Camel provides a default type converter registry.
  From Camel 3 onwards there type converter registry implementation uses source code generation via the Camel Maven
  Package Plugin to generate source code, that allows Camel at runtime to load and invoke these type converters via
  quick java method invocations. The older implementation in Camel 2 uses a annotation based discover to load and
  register type converters and invokes the type converters via Java method call reflections.
  
  
  [[TypeConverter-TypeConverterRegistry]]
  == TypeConverterRegistry
  
  Exposed the
  https://www.javadoc.io/doc/org.apache.camel/camel-api/current/org/apache/camel/spi/TypeConverterRegistry.html[TypeConverterRegistry]
  from xref:camelcontext.adoc[CamelContext] so end users more easily will
  be able to add type converters at runtime. This is also usable in
  situations where the default discovering of type converters fails on
  platforms with classloading issues.
  
  To access the registry, you get it from the `CamelContext`:
  
  [source,java]
  ----
  CamelContext context = ...
  context.getTypeConverterRegistry()
  ----
  
  [[TypeConverter-TypeConverterRegistryutilizationstatistics]]
  === TypeConverterRegistry utilization statistics
  
  Camel can gather utilization statistics of the runtime usage of type
  converters. These stats are available in JMX, and as well as from the
  `getStatistics()` method from `TypeConverterRegistry`.
  
  These statistics are turned off by
  default as there is some performance overhead under very high concurrent
  load. To enable the statistics in Java, do the following:
  
  [source,java]
  ----
  CamelContext context = ...
  context.setTypeConverterStatisticsEnabled(true);
  ----
  
  Or in the XML DSL with:
  
  [source,xml]
  ----
  
negative.code: [[TypeConverter-TypeConverter]]
  = Type Converter
  
  Converting body payloads from one type to another is common when routing messages between endpoints.
  Conversions regularly occur between the following types:
  
  * `File`
  * `String`
  * `byte[]` and `ByteBuffer`
  * `InputStream` and `OutputStream`
  * `Reader` and `Writer`
  * `Document` and `Source`
  
  To convert the body of a message to another type:
  
  [source,java]
  ----
  Message message = exchange.getIn();
  Document document = message.getBody(Document.class); // <1>
  ----
  <1> where https://www.javadoc.io/doc/org.apache.camel/camel-api/current/org/apache/camel/Message.html#getBody-java.lang.Class-[`Message#getBody(Class)`] performs the conversion.
  
  [[TypeConverter-HowTypeConversionworks]]
  == How Type Conversion works
  