= Apache Camel 3.x Upgrade Guide

This document is intended for helping you upgrade your Apache Camel application
from Camel 3.x to 3.y.

IMPORTANT: If you are migrating from Camel 2.x then use the
xref:camel-3-migration-guide.adoc[Camel 2.x to 3.0 Migration Guide].

For example if you are upgrading Camel 3.0 to 3.2, then you should follow the guides
from both 3.0 to 3.1 and 3.1 to 3.2.

== Upgrading Camel 3.0 to 3.1

=== camel-ahc, camel-netty-http, camel-undertow

These Camel components now no longer have dependency on Javax Servlet.

=== camel-undertow

The exception class `HttpOperationFailedException` is now from package `org.apache.camel.http.base` instead of `org.apache.camel.http.common`.
The Camel undertow producer throws this exception.

=== came-bean

The bean component has been changed to behave as singleton scoped by default.
This means that the bean is created or looked up once and reused.

The option `cache` has been deprecated in favour of the new `scope` option that by default is `Singleton`. You can set this to `Prototype` to use the old behaviour.

[NOTE]
====
Setting this to Prototype will let Camel create/lookup a new bean instance, per use; which acts as prototype scoped. However beware that if you lookup the bean, then the registry that holds the bean, would return a bean accordingly to its configuration, which can be singleton or prototype scoped. For example if you use Spring, or CDI, which has their own settings for setting bean scopes.
====

=== camel-etcd

The `camel-etcd` component has changed its endpoint syntax from `etcd:action/path` to
`etcd-keys:path`, `etcd-stats:path`, or `etcd-watch:path`.

For example before

[source,text]
----
etcd:stats/leader
----

Should be changed to
----
etcd-stats:leader
----

This change was needed as the 3 actions could not share the same component/endpoint and had to be separated.

=== camel-ftp

 The stepwise functionality (stepwise=true) is not supported for stream download (treamDownload=true).

=== camel-irc

The `camel-irc` component has changed its endpoint syntax and removed option #room as a part of the url path. Allowed syntax is:

[source,text]
----
irc:nick@host[:port]?[options]
----

=== camel-milo

The `camel-milo` client component has changed its endpoint syntax from `milo-client:tcp` to `milo-client:opc.tcp`.
For example before

[source,text]
----
milo-client:tcp://foo:bar@localhost:1234
----

Should be changed to
----
milo-client:opc.tcp://foo:bar@localhost:1234
----

The `camel-milo` server component requires Java 9 at runtime.
Property `strictEndpointUrlsEnabled` is no longer supported.
Properties`hostName` and `serverName` are replaced by `path`.
To successfully use certificates for secured communication, JCE Jurisdiction Policy File Default
has to be *Unlimited* (which is by default since Java 9+).

=== camel-nats

The `camel-nats` component has changed its endpoint syntax from `nats:servers` to `nats:topic`.
For example before

[source,text]
----
nats:myserver:4222?topic=myTopic
----

Should be changed to
----
nats:myTopic?servers=myserver:4222
----

This change is motivated by allowing to configure servers on component level,
and also for Spring Boot auto-configuration etc.

=== camel-nsq

The `camel-nsq` component has changed its endpoint syntax from `nsq:servers` to `nsq:topic`.
For example before

[source,text]
----
nsq:myserver:4161/myTopic
----

Should be changed to
----
nsq:myTopic?servers=myserver:4161
----

This change is motivated by allowing to configure servers on component level,
and also for Spring Boot auto-configuration etc.

=== camel-ipfs

The `camel-ipfs` component has changed its endpoint syntax from `nsq:host:port/command` to `ipfs:command`.
The host and port is now configured on the component level instead.

For example before

[source,text]
----
ipfs:127.0.0.1:5001/add
----

Should be changed to
----
ipfs:add
----

=== camel-xmlsecurity

The `camel-xmlsecurity` component has changed its endpoint syntax from `xmlsecurity:command/name` to
`xmlsecurity-sign:name`, `xmlsecurity-verify:name`.

For example before

[source,text]
----
xmlsecurity:verify/foo
----

Should be changed to
----
xmlsecurity-verify:foo
----

This change was needed as the 2 commands could not share the same component/endpoint and had to be separated.

=== spi-annotations

The `spi-annotations` JAR is mandatory but was mistakenly defined as optional scope. The content of this JAR
is now embedded directly into `camel-api` JAR so end users does not have to include or depend on `spi-annotations` JAR anymore.

=== camel-core-engine and camel-jaxp

XML and JAXB has been moved out of camel-base and camel-core-engine.

The module camel-jaxp has been renamed to camel-xml-jaxp.

The camel-xml-jaxp JAR has XML parsers and type converters.
The camel-xml-jaxb has support for loading XML DSL routes using JAXB.
An alternative is to use the new camel-xml-io for loading XML routes which is more light-weight and faster than JAXB.

=== JAXB is now optional

JAXB is now optional in Camel and only needed when using XML routes with the `camel-xml-jaxb` JAR
for loading and parsing the routes with JAXB. There is an alternative implementation with `camel-xml-io` (see above).

This means that `jaxb-core` and `jaxb-impl` JARs no longer are needed on the classpath and as such has been removed
as dependency in the various Camel `pom.xml` files.

There are a number of components that uses JAXB such as `camel-spring`, `camel-blueprint`, `camel-cdi` for their support
of using XML for beans and Camel XML routes. And a few components such as `camel-soap` etc.

But at general then Camel is now lighter in classpath dependency by not requiring to have JAXB present.

=== Package scanning @TypeConverter

Camel has now been configured to not package scan for custom `@Converter` classes on startup.
Type converters are now loaded and registered in faster way via source code generated loader classes
by having `@Converter(loader = true)` specified. If you have custom converters and have not migrated to use
source code generated loaders, you can enable package scanning by setting

[source,java]
----
camelContext.setLoadTypeConverters(true);
----

And in XML:
[source,xml]
----
<camelContext loadTypeConverters="true">
...
</camelContext>
----

And in Spring Boot `application.properties`:
[source,properties]
----
camel.loadTypeConverters=true
----

=== Graceful Shutdown Timeout

When shutting down Camel, then the default timeout has changed from 300 seconds (5 minutes) to 45 seconds.
The 45 seconds was chosen as 30 seconds is a common timeout to use for remote protocols, so we wanted to give
Camel a bit more time, and hence added 15 seconds so the default is 45 seconds.

=== Message History

The message history is now default disabled (due to optimize core for lower footprint out of the box).
See the xref:{eip-vc}:eips:message-history.adoc[Message History] documentation for how to enabled message history.

=== Inflight Repository

The inflight repository now does no longer allow browsing each individual exchange (due to optimize core for lower footprint out of the box).
To enable browsing then you can turn this on via:

[source,java]
----
    context.getInflightRepository().setInflightBrowseEnabled(true);
----

And in XML DSL:

[source,xml]
----
<camelContext inflightRepositoryBrowseEnabled="true">

</camelContext>
----

=== Component Extension Verifier

When using component verifier (`org.apache.camel.component.extension.ComponentVerifierExtension`) then you
would know need to add `camel-core-catalog` to the classpath to make this useable. If the JAR is missing,
there will be an exception stating that `RuntimeCamelCatalog` is not found and that this JAR should be added.

=== ManagedRuntimeCatalog

The `ManagedRuntimeCatalog` JMX MBean is removed and no longer available.

=== Spring Boot JMX

The `camel-management` dependency of `camel-spring-boot` was removed as Spring Boot 2.2+ disables JMX by default.

To continue using JMX with Camel Spring Boot add the following dependency:

[source,xml]
----
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-management</artifactId>
</dependency>
----

=== Custom components

Camel now uses Camel Package Maven Plugin instead of `camel-apt` APT compiler to generate component meta data.

Custom components should then change in the pom.xml from:

[source,xml]
----
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>apt</artifactId>
  <scope>provided</scope>
</dependency>
----

To the following:

[source,xml]
----
      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-package-maven-plugin</artifactId>
        <version>${camel-version}</version>
        <executions>
          <execution>
            <id>generate</id>
            <goals>
              <goal>generate-component</goal>
            </goals>
            <phase>process-classes</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>initialize</phase>
            <goals>
              <goal>add-source</goal>
              <goal>add-resource</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/generated/java</source>
              </sources>
              <resources>
                <resource>
                  <directory>src/generated/resources</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!--
      Recompile source after generated loader classes have been created.
      The maven-compiler-plugin must be defined in the POM after the
      camel-package-maven-plugin so recompile runs after generated
      sources have been created.

      Adjust configuration for the JDK version your project uses.
      -->
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
          <configuration>
              <source>1.11</source>
              <target>1.11</target>
          </configuration>
          <executions>
              <execution>
                  <id>recompile</id>
                  <goals>
                      <goal>compile</goal>
                  </goals>
                  <phase>process-classes</phase>
              </execution>
          </executions>
      </plugin>
----

=== API changes

==== log changed to private static LOG

The `ServiceSupport` class has changed its logging from instance to static, which means any inherited class that
uses `log` would need to change the code to compile. This may happen in custom Camel components.

Before you may have:

[source,java]
----
    log.debug("Sending message to foobar service: {}", messageId);
----

You then need to migrate the logging to also be static:

[source,java]
----
    private static final Logger LOG = LoggerFactory.getLogger(FooBarProducer.class);

    LOG.debug("Sending message to foobar service: {}", messageId);
----

==== Exchange

The `Exchange` API has been modified slightly as part of an optimization effort.
The returned value of `getCreated` is changed from `java.util.Date` to `long` which is the time millis.
The `Exchange.CREATED_TIMESTAMP` is no longer stored as exchange property, but you should use the `getCreated` method on `Exchange`.
The returned value of `isExternalRedelivered` is changed from `Boolean` to `boolean`.

Some of the advanced and API for component developers on `Exchange` has been moved to an extended interface `ExtendedExchange`.
The following methods has been moved:

- setFromEndpoint
- setFromRouteId
- setUnitOfWork
- addOnCompletion
- containsOnCompletion
- handoverCompletions

You can use these methods by adapting to the extended exchange as shown below:

[source,java]
----
exchange.adapt(ExtendedExchange.class).addOnCompletion(...);
----

==== Message

The message ID will now default to use the same id as Exchange ID as messages are associated with the exchange
and using different IDs does not offer much value. Another reason is to optimize for performance to avoid generating new IDs.
A few Camel components do provide their own message IDs such as the JMS components.

==== UnitOfWork

For advanced Camel users whom implement custom `UnitOfWork` should implement the new `isBeforeAfterProcess()' method and return true of false,
whether Camel should invoke the before and after processor methods.

The method `getId` has been removed.

==== Cookies

Cookies from `camel-http-common` has been moved into a new `camel-http-base` JAR.
The package `org.apache.camel.http.common.cookie` is renamed to `org.apache.camel.http.base.cookie`.

==== Exchange.ROUTE_STOP

To signal an `Exchange` to stop continue routing has changed from setting the exchange property `Exchange.ROUTE_STOP` to true.
Instead you should now use the `setRouteStop` method on the `Exchange` API.

[source,java]
----
    exchange.setProperty(Exchange.ROUTE_STOP, Boolean.TRUE);
----

Should now be:
[source,java]
----
    exchange.setRouteStop(true);
----

==== Exchange.ROLLBACK_ONLY and Exchange.ROLLBACK_ONLY_LAST

To signal an `Exchange` to rollback a transaction has changed from setting the exchange property `Exchange.ROLLBACK_ONLY` to true.
Instead you should now use the `setRollbackOnly` method on the `Exchange` API (the same for rollback only last).

[source,java]
----
    exchange.setProperty(Exchange.ROLLBACK_ONLY, Boolean.TRUE);
----

Should now be:

[source,java]
----
    exchange.setRollbackOnly(true);
----

==== Exchange.ERRORHANDLER_HANDLED

The exchange property `Exchange.ERRORHANDLER_HANDLED` was used to indicate that the error handling mechanism for a given exchange
had completed.  This property sometimes had to be conveyed by aggregation strategies, so instead of

[source,java]
----
    oldExchange.getProperties().put(
            Exchange.ERRORHANDLER_HANDLED,
            newExchange.getProperties().get(Exchange.ERRORHANDLER_HANDLED));
----

one should now use:

[source,java]
----
    Boolean handled = newExchange.adapt(ExtendedExchange.class)
            .getErrorHandlerHandled();
    oldExchange.adapt(ExtendedExchange.class)
            .setErrorHandlerHandled(handled);
----

==== ModelHelper removed

The class `org.apache.camel.model.ModelHelper` has been removed. Instead you can use its functionality from `ExtendedCamelContext` by
the `getModelToXMLDumper` and `getXMLRoutesDefinitionLoader` methods which has APIs similar to `ModelHelper`.

==== JsonSchemaHelper removed

The class `org.apache.camel.tooling.util.JSonSchemaHelper` has been removed. Instead you can use utils coming from camel-util-json
and the class `org.apache.camel.tooling.util.PackageHelper`

==== camel-xml-jaxp

The class `org.apache.camel.processor.validation.PredicateValidatingProcessor` has moved from `camel-xml-jaxp` JAR
to `camel-support` JAR and renamed to `org.apache.camel.support.processor.PredicateValidatingProcessor`.

==== Java DSL

The Java DSL has been revisited and the following methods have been removed:

* ExpressionClause::body(Supplier<Object>)
* MulticastDefinition::onPrepare(Supplier<Processor>)
* ProcessorDefinition::process(Supplier<Processor>)
* ProcessorDefinition::setBody(Supplier<Result>)
* RecipientListDefinition::onPrepare(Supplier<Processor>)
* SplitDefinition::onPrepare(Supplier<Processor>)
* WireTapDefinition::newExchange(Supplier<Processor>)
* WireTapDefinition::onPrepare(Supplier<Processor>)

This change is motivated by the need to remove method ambiguity for untyped languages such as Groovy and JavaScript, for more info see https://issues.apache.org/jira/browse/CAMEL-14300

==== CamelContext

Some unused methods have been removed from `CamelContext` which were not part of the public API. The following methods have been removed:

* getProducerServicePool
* setProducerServicePool
* getPollingConsumerServicePool
* setPollingConsumerServicePool

==== Internal API changes

Remove the method `getProcessors` from `Pipeline` as you should use the `next` method instead to access a read-only view of the processors.

==== @Experimental

The `@Experimental` annotation is moved from `meta-annotations` JAR to `camel-api`
and moved from package `org.apache.camel.meta` to `org.apache.camel`.
And the meta-annotations has been removed.

==== Property Placeholders

The support for out-of-band property placeholders has been removed.
This means that XML that were using the `http://camel.apache.org/schema/placeholder`
namespace and that the java builders using the `.placeholder(key, value).` have to
be modified.

[source,java]
----
    from("direct:start")
        .multicast()
        .placeholder("stopOnException", "stop")
        .to("mock:a")
----
should be rewritten as:
[source,java]
----
    from("direct:start")
        .multicast()
        .stopOnException("{{stop}}")
        .to("mock:a")
----

and
[source,xml]
----
   <route>
        <from uri="direct:start"/>
        <multicast prop:stopOnException="stop">
            <to uri="mock:a"/>
        </multicast>
    </route>
----
should be rewritten as:
[source,xml]
----
   <route>
        <from uri="direct:start"/>
        <multicast stopOnException="{{stop}}">
            <to uri="mock:a"/>
        </multicast>
    </route>
----

== Upgrading Camel 3.1 to 3.2

=== JndiRegistry

The deprecated class `org.apache.camel.impl.JndiRegistry` has been removed. The class `org.apache.camel.support.jndi.JndiBeanRepository` located in `org.apache.camel:camel-support` should be used instead.

=== Rest Configuration

The rest configuration has been simplified and there is now a single RestConfiguration instance (https://issues.apache.org/jira/browse/CAMEL-13844[CAMEL-13844]) per Camel Context.

The following methods have been removed:

* org.apache.camel.CamelContext#addRestConfiguration(RestConfiguration restConfiguration)
* org.apache.camel.CamelContext#getRestConfiguration(String component, boolean defaultIfNotFound)
* org.apache.camel.CamelContext#getRestConfigurations

https://issues.apache.org/jira/browse/CAMEL-13844

=== Camel Cloud

The following `ServiceDiscovery` implementation has been removed: 

* org.apache.camel.impl.cloud.CachingServiceDiscovery
* org.apache.camel.impl.cloud.CachingServiceDiscoveryFactory

https://issues.apache.org/jira/browse/CAMEL-14813

=== Camel with Karaf and OSGi

Camel on Apache Karaf / OSGi has been moved to its own project at: https://github.com/apache/camel-karaf

The Maven dependencies has changed the groupid from `org.apache.camel` to `org.apache.camel.karaf`.

For example the `camel-blueprint` would be changed from

[source,xml]
----
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-blueprint</artifactId>
  <version>3.1.0</version>
</dependency>
----

To:

[source,xml]
----
<dependency>
  <groupId>org.apache.camel.karaf</groupId>
  <artifactId>camel-blueprint</artifactId>
  <version>3.2.0</version>
</dependency>
----

The Camel Karaf features are the same as before, you can still install Camel in Karaf shell via:
[source,text]
----
feature:repo-add camel 3.2.0
feature:install camel
----

==== Other components involved

- Camel-test-blueprint

[source,xml]
----
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-test-blueprint</artifactId>
  <version>3.1.0</version>
</dependency>
----

To:

[source,xml]
----
<dependency>
  <groupId>org.apache.camel.karaf</groupId>
  <artifactId>camel-test-blueprint</artifactId>
  <version>3.2.0</version>
</dependency>
----

- Camel-test-karaf

[source,xml]
----
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-test-karaf</artifactId>
  <version>3.1.0</version>
</dependency>
----

To:

[source,xml]
----
<dependency>
  <groupId>org.apache.camel.karaf</groupId>
  <artifactId>camel-test-karaf</artifactId>
  <version>3.2.0</version>
</dependency>
----

- Camel-eventadmin

[source,xml]
----
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-eventadmin</artifactId>
  <version>3.1.0</version>
</dependency>
----

To:

[source,xml]
----
<dependency>
  <groupId>org.apache.camel.karaf</groupId>
  <artifactId>camel-eventadmin</artifactId>
  <version>3.2.0</version>
</dependency>
----

- Camel-kura

[source,xml]
----
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-kura</artifactId>
  <version>3.1.0</version>
</dependency>
----

To:

[source,xml]
----
<dependency>
  <groupId>org.apache.camel.karaf</groupId>
  <artifactId>camel-kura</artifactId>
  <version>3.2.0</version>
</dependency>
----

- Camel-osgi-activator

[source,xml]
----
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-osgi-activator</artifactId>
  <version>3.1.0</version>
</dependency>
----

To:

[source,xml]
----
<dependency>
  <groupId>org.apache.camel.karaf</groupId>
  <artifactId>camel-osgi-activator</artifactId>
  <version>3.2.0</version>
</dependency>
----

- Camel-paxlogging

[source,xml]
----
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-paxlogging</artifactId>
  <version>3.1.0</version>
</dependency>
----

To:

[source,xml]
----
<dependency>
  <groupId>org.apache.camel.karaf</groupId>
  <artifactId>camel-paxlogging</artifactId>
  <version>3.2.0</version>
</dependency>
----

==== Introducing a camel-karaf-bom

We introduce a camel-karaf-bom too, so the end-users should be able to have all of this dependencies easier:

[source,xml]
----
    <dependencyManagement>
        <dependencies>
            <!-- Add Camel BOM -->
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- Add Camel Karaf BOM -->
            <dependency>
                <groupId>org.apache.camel.karaf</groupId>
                <artifactId>camel-karaf-bom</artifactId>
                <version>${camel.karaf.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
----

In this way you'll get both the boms and all the "goodies"

=== camel-elytron

Transitive dependencies from org.wildfly.security:wildfly-elytron were removed.

=== camel-spark-rest

This component has been removed. Use any of the other REST capable components, such as `camel-jetty`, `camel-netty-http`
or `camel-undertow`.

=== EIPs with cacheSize option

The `cacheSize` option on EIPs has been improved to reduce memory usage when the cache is disabled by
setting the value to -1. One of the optimizations is that new endpoints will not be added to the endpoint registry,
but discarded after use. This avoids storing additional endpoints in the cache (memory) as the cache should be disabled (cacheSize=-1).

See more details in the documentation for the `cacheSize` option on the EIPs.

=== Configuring components via Java setters

Configuring Camel components from plain Java code has changed in some components where they were using
delegate setters for a nested configuration class. These delegates has been removed, to ensure configuration
is more consistent and aligned with how endpoints is configured as well, and by using source code generated configurer classes.

The following Camel components has been affected and changed on the component level:

- camel-aws
- camel-aws2
- camel-consul
- camel-etcd
- camel-infinispan
- camel-kafka
- camel-servicenow
- camel-ssh
- camel-stomp
- camel-xmlsecurity
- camel-yammer

This only affects if you are configuring these components using Java code or XML `<bean>` style.

For example

[source,java]
----
KafkaComponent kafka = new KafkaComponent();
kafka.setBrokers("mybroker1:1234,mybroker2:1234");
----

Should now be:

[source,java]
----
KafkaComponent kafka = new KafkaComponent();
kafka.getConfiguration().setBrokers("mybroker1:1234,mybroker2:1234");
----

And in XML:

[source,xml]
----
<bean id="kafka" class="org.apache.camel.component.kafka.KafkaComponent">
  <property name="brokers" value="mybroker1:1234,mybroker2:1234"/>
</bean>
----

Should now be:

[source,xml]
----
<bean id="kafka" class="org.apache.camel.component.kafka.KafkaComponent">
  <property name="configuration">
    <property name="brokers" value="mybroker1:1234,mybroker2:1234"/>
  </property>
</bean>
----

=== Configuring components via Spring Boot auto configuration

Configuring Camel spring boot components has changed its option keys to be flattened and have the `.configuration` prefix
removed now.

Before in application.properties

[source,properties]
----
camel.component.kafka.configuration.brokers=mybroker1:1234,mybroker2:1234
----

Should now be
[source,properties]
----
camel.component.kafka.brokers=mybroker1:1234,mybroker2:1234
----

This applies to all the Camel spring boot _starter_ JARs where basically `.configuration` should be removed.

=== Configuring camel-activemq, camel-amqp and camel-stomp via Spring Boot auto configuration

When configuring these components from spring boot auto-configuration then the URL for the broker was named `broker-u-r-l`
in the spring boot auto configuration support. This has been renamed to `broker-url` and a few other options too.

Before:

[source,properties]
----
camel.component.activemq.broker-u-r-l=tcp://localhost:61616
----

After:

[source,properties]
----
camel.component.activemq.broker-url=tcp://localhost:61616
----

=== camel-any23

The XML DSL has changed for the `<configuration>` element, which now
is flattened so the key/values should be configured on it directly:

Before:
[source,xml]
----
<dataFormats>
  <any23 id="any23" baseURI ="http://mock.foo/bar" outputFormat="TURTLE" >
    <configuration>
      <property key="any23.extraction.metadata.nesting" value="off" />
      <property key="another-key" value="another-value" />
    </configuration>
    <extractors>html-head-title</extractors>
  </any23>
</dataFormats>
----

After:

[source,xml]
----
<dataFormats>
  <any23 id="any23" baseURI ="http://mock.foo/bar" outputFormat="TURTLE" >
    <configuration key="any23.extraction.metadata.nesting" value="off"/>
    <configuration key="another-key" value="another-value"/>
    <extractors>html-head-title</extractors>
  </any23>
</dataFormats>
----

=== camel-avro

The avro component and data format has been split up into two JARs. The dataformat is in `camel-avro` JAR
and the component in `camel-avro-rpc` JAR.

=== camel-infinispan

Camel now requires endpoint URIs to include context-path which means
the endpoint URI `infinispan` should be changed to `infinispan:current`.

=== google-pubnub

The google-pubnub component has been improved to use a new Java library and become faster.

Support for Apache Karaf has been removed.

=== camel-xstream

The XML DSL has changed for the `<converters>`, `<alias>`, `implicitCollections`, and `omitFields` elements,
which now is flattened so the key/values should be configured on it directly.

Before:
[source,xml]
----
<xstream id="xstream-1" mode="NO_REFERENCES"
    permissions="-org.apache.camel.dataformat.xstream.*,org.apache.camel.dataformat.xstream.PurchaseHistory,org.apache.camel.dataformat.xstream.PurchaseOrder">
    <converters>
        <converter class="org.apache.camel.dataformat.xstream.XStreamConfigurationTest$PurchaseOrderConverter" />
    </converters>
    <aliases>
                <alias name="purchase-order" class="org.apache.camel.dataformat.xstream.PurchaseOrder" />
    </aliases>
    <implicitCollections>
       <class name="org.apache.camel.dataformat.xstream.PurchaseHistory">
          <field>history</field>
       </class>
    </implicitCollections>
</xstream>
----

After:
[source,xml]
----
<xstream id="xstream-1" mode="NO_REFERENCES"
    permissions="-org.apache.camel.dataformat.xstream.*,org.apache.camel.dataformat.xstream.PurchaseHistory,org.apache.camel.dataformat.xstream.PurchaseOrder">
    <converters key="purchase-converter" value="org.apache.camel.dataformat.xstream.XStreamConfigurationTest$PurchaseOrderConverter"/>
    <aliases key="purchase-order" value="org.apache.camel.dataformat.xstream.PurchaseOrder"/>
    <implicitCollections key="org.apache.camel.dataformat.xstream.PurchaseHistory" value="history"/>
</xstream>
----

Multiple values for `implicitCollections` and `omitFields` can be separated by comma

For example:
[source,xml]
----
<implicitCollections key="org.apache.camel.dataformat.xstream.PurchaseHistory" value="history,adress"/>
----

=== camel-weather

This component has been upgraded from using Apache Http Client 3.x to 4.x and is therefore not fully backwards compatible.
Some options for configurer and setting proxy is removed. You can however configure this directly on a custom `HttpClient` instance
and set this on the `WeatherComponent` to use.

=== Endpoint URIs without context path

Previously Camel components may work by referring to their name only without a colon and context path (eg `log`)
that for a few components would allow them to create an endpoint anyway.

Now this is not allowed and Camel will throw an `NoSuchEndpointException`.

An endpoint by its logical id can still be referred by the id only, eg
[source,java]
----
Endpoint endpoint = camelContext.getEndpoint("myCoolEndpoint");
----

=== Error handling

The context scope error handling has been modified a bit.  The processors in those `onException` and
`onCompletion` are not shared between routes anymore.  This should have little effect in most cases.
If there is a need to have a single set of processors involved (such as when using a loadbalancer or
other stateful patterns), then an intermediary route needs to be used. The following excerpt:

[source,java]
----
onException(Exception.class).handled(true)
    .loadBalance().roundRobin().id("round")
    .to("mock:error", "mock:error2", "mock:error3");
----

... needs to be rewritten as:

[source,java]
----
onException(Exception.class).handled(true).to("direct:error");

from("direct:error").loadBalance().roundRobin().id("round")
    .to("mock:error", "mock:error2", "mock:error3");
----

=== camel-cluster

The base support for cluster in `org.apache.camel.cluster` has been moved
out of `camel-core-engine` into separate JAR named `camel-cluster`.

=== Configuring milli seconds

Camel was using a type converter from `String` -> `long` that accepted
a time pattern which allowed to configure long values such as `2s` for 2 seconds, e.g. `2000`.
And more complex such as `8h15m` for 8 hours and 15 minutes.

However as this was implemented as part of `String` -> `long` type conversion
which then adds a little bit of overhead during routing, when converting from String to plain numbers.

To make Camel routing engine as fast as possible this feature has been removed.

For example a timer with a 5 second period

[source,java]
----
from("timer:foo?period=5s")
----

Should now be specified as numeric only:

[source,java]
----
from("timer:foo?period=5000")
----

=== Main in camel-spring

The `org.apache.camel.spring.Main` class has been moved out of `camel-spring` JAR into its own
JAR named `camel-spring-main`.

=== Main in camel-test-blueprint

The `org.apache.camel.test.blueprint.Main` class has been renamed to `org.apache.camel.test.blueprint.Main`
and moved into its own `camel-test-blueprint` JAR.

To use the camel-maven-plugin goal `camel:run` with OSGi plugin, you now need to add the following dependency
to the classpath `org.apache.camel.karaf:camel-blueprint-main`.

=== API changes

==== DefaultComponent

The deprecated method `preProcessUri` has been removed.

==== CamelContext

The method `getEndpoint` now throws `NoSuchEndpointException` directly instead of being wrapped
within an `FailedToResolveEndpoint`.

==== JavaUuidGenerator

The `org.apache.camel.impl.engine.JavaUuidGenerator` class has been removed.
Its a very slow UUID generator and its not recommended to be used.

==== PropertiesComponent

The `org.apache.camel.component.properties.PropertiesFunction` has been moved to `org.apache.camel.spi.PropertiesFunction`
and its now possible to add custom functions on the `org.apache.camel.spi.PropertiesComponent` interface.

====  JMX Connector configuration removed

The JMX Connector configuration in camel-management has been https://issues.apache.org/jira/browse/CAMEL-14811[removed]
in Camel 3.2.0. If you want to support the ability to use JMX with Camel remotely, then
just use the default JVM JMX remote capabilities. For example, use the following (insecure)
JVM settings to be able to manage Camel remotely on localhost, port 9913:

[source]
----
-Dcom.sun.management.jmxremote.port=9913
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=localhost
----

== Upgrading Camel 3.2 to 3.3

=== camel-jackson

The dependency on `jackson-module-jaxb-annotations` and the option `enableJaxbAnnotationModule` have been removed. To
enable support for JAXB annotations, users have to:

* explicit add `jackson-module-jaxb-annotations`
* configure the `JacksonDataFormat` and/or the `JacksonTypeConverters` module classes, example:
+
.JacksonDataFormat
[source,java]
----
JacksonDataFormat formatPojo = new JacksonDataFormat(TestJAXBPojo.class);
formatPojo.setModuleClassNames(JaxbAnnotationModule.class.getName());
----
+
.JacksonTypeConverters
[source,java]
----
context.getGlobalOptions().put(JacksonConstants.ENABLE_TYPE_CONVERTER, "true");
context.getGlobalOptions().put(JacksonConstants.TYPE_CONVERTER_TO_POJO, "true");
context.getGlobalOptions().put(JacksonConstants.TYPE_CONVERTER_MODULE_CLASS_NAMES, JaxbAnnotationModule.class.getName());
----

this change affects also the Java DSL and as consequence the `enableJaxbAnnotationModule` option for the Json 
DataFormat definition has been removed.

=== Template components

The template components which supports using a header to specify a dynamic resource to use as template, instead
of the configured template on the endpoint is now enabled out of the box. If you want to use this feature then
you must turn on `allowTemplateFromHeader=true` on either the endpoint or component level.

This applies to the following templating components: camel-freemarker, camel-velocity, camel-mvel, camel-mustache,
camel-string-template, camel-chunk, camel-jolt, camel-jslt, camel-robotframework.

=== SupervisingRouteController

The `SupervisingRouteController` has been refactored and its configuration has been simplified.
And when configuring from spring boot, then the auto configuration parameters has
been changed from `camel.supervising.controller` into the general `camel.springboot` which
allows to share the same configuration across runtimes so its the same in Spring Boot, Camel Main,
Camel K, Camel Quarkus, etc.

=== Camel Karaf

The following components is no longer supported in OSGi and has been removed from the Camel Karaf features file:
camel-undertow, camel-jgroups, camel-jgroups-raft, camel-infinspan.

=== camel-maven-plugin

The `embedded` goal has been removed (was never really in use). Use `run` goal instead.

=== API changes

The dump model classes in package `org.apache.camel.support.dump` has been removed
as they were not in use by Camel.

In relation to the dump model classes removal, in camel-karaf the following commands were removed: `context-info`, `route-info`, `route-profile` and `route-step`.

