<commit_before>= Apache Camel 3.x Upgrade Guide

This document is for helping you upgrade your Apache Camel application
from Camel 3.x to 3.y. 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.7 to 3.8

=== Route startup procedure change

Camel will now initialize all routes during initialization of `CamelContext` itself.
Before all routes where lazy initialized when they were started, which happens in the starting phase of `CamelContext`.
By moving this forward to initialization phase, we ensure all is done together.

This means that all the resources used in the routes such as EIPs, processors, beans, components, data formats, languages etc.
are also initialized. An affect of this change is that any custom Camel component that may do initialization logic in
the constructors of `Consumer` or `Producer` should *not* do this, but move this logic to `doInit` or `doStart` where
such logic belongs.

=== API changes

The following type names are renamed in `CamelEvent.Type` enum:

- `CamelContextRoutesStarting` to `RoutesStarting`
- `CamelContextRoutesStarted` to `RoutesStarted`
- `CamelContextRoutesStopping` to `RoutesStopping`
- `CamelContextRoutesStopped` to `RoutesStopped`

The method `isOnlyDynamicQueryParameters` was removed from `org.apache.camel.spi.SendDynamicAware` and
`org.apache.camel.support.component.SendDynamicAwareSupport` classes.

The class `PackageScanResourceResolver` has been revisited and the method `findResources` now returns a collection of `org.apache.camel.spi.Resource`
which provide both the location of the resolved resources and a method to open the related `InpuStream`:

[source,java]
----
Collection<Resource> findResources(String location) throws Exception;
----

=== OnCompletion EIP

The `onCompletion` EIP has been fixed. It could trigger multiple completions for a given `Exchange` before.

=== Transactions and Multicast, Splitter, or Recipient List EIPs

When using `transacted` in Camel routes with Multicast, Splitter, or Recipient List EIPs, the exection strackframe
could grown deep and this could cause a stack overflow exception. This has been fixed by refactoring the EIP into a special
transacted mode and the existing reactive mode.

We do not anticipate any issues but if you are using transactions and these EIPs then we would like to have feedback
if you encounter any problems with upgrading.

=== camel-jackson

In the XML DSL `jsonView` has been renamed to `jsonViewTypeName` and made general available in the model
and for the lightweight `camel-xml-io` route parser.

=== camel-caffeine-lrucache

This LRUCache implementation is using an algorithm where elements that are removed may not be in strict order, and therefore
not ideal for LRU caches assuming ordering.

The implementation is not needed anymore in Camel 3, as we are using a simpler default implementation internally.
This component was deprecated, and has been removed as Maven dependency in `camel-core` pom.xml file.

=== camel-infinispan

The infinispan component has been splitup into client and embedded server mode.
The module `camel-infinispan` is the client mode, and `camel-infinispan-embedded` is for server mode.
Most use cases would be client mode to integrate with an existing Infinispan cluster, therefore it was choosen
to be the `camel-infinispan` component.<commit_msg>The Camel 3.8 Upgrade guide contained two sections for the camel-infinispan component. Remove the less detailed one.<commit_after>= Apache Camel 3.x Upgrade Guide

This document is for helping you upgrade your Apache Camel application
from Camel 3.x to 3.y. 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.7 to 3.8

=== Route startup procedure change

Camel will now initialize all routes during initialization of `CamelContext` itself.
Before all routes where lazy initialized when they were started, which happens in the starting phase of `CamelContext`.
By moving this forward to initialization phase, we ensure all is done together.

This means that all the resources used in the routes such as EIPs, processors, beans, components, data formats, languages etc.
are also initialized. An affect of this change is that any custom Camel component that may do initialization logic in
the constructors of `Consumer` or `Producer` should *not* do this, but move this logic to `doInit` or `doStart` where
such logic belongs.

=== API changes

The following type names are renamed in `CamelEvent.Type` enum:

- `CamelContextRoutesStarting` to `RoutesStarting`
- `CamelContextRoutesStarted` to `RoutesStarted`
- `CamelContextRoutesStopping` to `RoutesStopping`
- `CamelContextRoutesStopped` to `RoutesStopped`

The method `isOnlyDynamicQueryParameters` was removed from `org.apache.camel.spi.SendDynamicAware` and
`org.apache.camel.support.component.SendDynamicAwareSupport` classes.

The class `PackageScanResourceResolver` has been revisited and the method `findResources` now returns a collection of `org.apache.camel.spi.Resource`
which provide both the location of the resolved resources and a method to open the related `InpuStream`:

[source,java]
----
Collection<Resource> findResources(String location) throws Exception;
----

=== OnCompletion EIP

The `onCompletion` EIP has been fixed. It could trigger multiple completions for a given `Exchange` before.

=== Transactions and Multicast, Splitter, or Recipient List EIPs

When using `transacted` in Camel routes with Multicast, Splitter, or Recipient List EIPs, the exection strackframe
could grown deep and this could cause a stack overflow exception. This has been fixed by refactoring the EIP into a special
transacted mode and the existing reactive mode.

We do not anticipate any issues but if you are using transactions and these EIPs then we would like to have feedback
if you encounter any problems with upgrading.

=== camel-jackson

In the XML DSL `jsonView` has been renamed to `jsonViewTypeName` and made general available in the model
and for the lightweight `camel-xml-io` route parser.

=== camel-caffeine-lrucache

This LRUCache implementation is using an algorithm where elements that are removed may not be in strict order, and therefore
not ideal for LRU caches assuming ordering.

The implementation is not needed anymore in Camel 3, as we are using a simpler default implementation internally.
This component was deprecated, and has been removed as Maven dependency in `camel-core` pom.xml file.
{'fraction_non_alphanumeric': 0.05601943221496888, 'fraction_numerical': 0.006376195536663124, 'mean_word_length': 4.951219512195122, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6202969', 'n_tokens_mistral': 1797, 'n_tokens_neox': 1712, 'n_words': 900}