// Metadata created by nebel
// ParentAssemblies: assemblies/getting-started/as_managing-registry-artifacts.adoc

[id="migrating-registry-applications_{context}"]
= Migrating {registry} client applications

[role="_abstract"]
You must review your existing {registry} client applications to ensure that the Maven dependencies and Java client configuration meet the new requirements for version 3.x. For example, this includes new Maven dependencies for the {registry} Java REST client libraries or Kafka client serializer/deserializer (Serdes) libraries. You must also update your Java application configuration with the new registry v3 API path.


.Prerequisites 
* Existing {registry} {registry-v2} Java client application or Kafka client producer and consumer Java applications with SerDes

.Procedure
. If you are using the {registry} Java REST client, you must change the Maven dependencies for the {registry} Java client libraries, which have been repackaged in version 3.x:
+
[source, xml, subs="attributes+"]
----
<dependency>
    <groupId>io.apicurio</groupId>
    <artifactId>apicurio-registry-java-sdk</artifactId>
    <version>{registry-release}</version>
</dependency>
----

. In your Java client application, you must change your registry URL configuration, from pointing to the existing v2 API path to the new v3 path. Starting with v3, we use Vertx as the default platform for our rest client, due to this change, a RequestAdapter is required when the client is created. For example:
+
[source,java, subs="attributes+"]
----
public class ClientExample {


     public static void main(String[] args) throws Exception {
         VertXRequestAdapter vertXRequestAdapter = new VertXRequestAdapter(vertx);
         vertXRequestAdapter.setBaseUrl("https://new-registry.my-company.com/apis/registry/v3");
         RegistryClient client = new RegistryClient(vertXRequestAdapter);
    }
}
----
+
You can find more details on the Java client in 
ifdef::apicurio-registry[]
{rest-client}. 
endif::[]
ifdef::rh-service-registry[]
the link:{LinkServiceRegistryUser}#using-the-registry-sdk[{NameServiceRegistryUser}].
endif::[]

. If you are using the {registry} SerDes libraries, you must change the Maven dependencies, which have been repackaged in version 3.x. In {registry} {registry-v2}, the SerDes libraries were provided into three separate Maven modules, while this is still true, the names have been changed:
+
[source, xml, subs="attributes+"]
----
<dependency>
    <groupId>io.apicurio</groupId>
    <artifactId>apicurio-registry-avro-serde-kafka</artifactId>
    <version>{registry-release}</version>
</dependency>
<dependency>
    <groupId>io.apicurio</groupId>
    <artifactId>apicurio-registry-jsonschema-serde-kafka</artifactId>
    <version>{registry-release}</version>
</dependency>
<dependency>
    <groupId>io.apicurio</groupId>
    <artifactId>apicurio-registry-protobuf-serde-kafka</artifactId>
    <version>{registry-release}</version>
</dependency>
----
+
In {registry} 3.x, the SerDes libraries have been significantly refactored to make them re-usable for other messaging platforms like Apache Pulsar, that's why the Apache Kafka specific ones have been renamed.
+

. In your Kafka producer and consumer Java applications, you must change your registry URL configuration from pointing to the existing v2 API path to the new v3 path. For example:
+
_Existing registry v2 API path_:
+
[source,java]
----
props.putIfAbsent(SerdeConfig.REGISTRY_URL, "http://new-registry.my-company.com/apis/registry/v3");
----
+
_New registry v3 API path_:
+
[source,java, subs="attributes+"]
----
props.putIfAbsent(SerdeConfig.REGISTRY_URL, "http://new-registry.my-company.com/apis/registry/v3");
----
+
The refactored SerDes libraries also include other important changes to configuration properties. For more details on SerDes configuration, see
ifdef::apicurio-registry[]
{kafka-client-serdes}. 
endif::[]
ifdef::rh-service-registry[]
the link:{LinkServiceRegistryUser}#using-kafka-client-serdes[{NameServiceRegistryUser}].
endif::[]

[role="_additional-resources"]
.Additional resources
* For detailed configuration examples, see the link:https://github.com/Apicurio/apicurio-registry/tree/main/examples[Apicurio Registry example applications].
