Skip to content

Commit

Permalink
Upgrade Camel to 4.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnetherton committed Mar 7, 2024
1 parent fc01220 commit a03b66f
Show file tree
Hide file tree
Showing 29 changed files with 1,402 additions and 1,330 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ public class QuarkusRuntimeProvider implements RuntimeProvider {
private static final String COMPONENT_DIR = "org/apache/camel/catalog/quarkus/components";
private static final String DATAFORMAT_DIR = "org/apache/camel/catalog/quarkus/dataformats";
private static final String LANGUAGE_DIR = "org/apache/camel/catalog/quarkus/languages";
private static final String TRANSFORMER_DIR = "org/apache/camel/catalog/quarkus/transformers";
private static final String OTHER_DIR = "org/apache/camel/catalog/quarkus/others";
private static final String COMPONENTS_CATALOG = "org/apache/camel/catalog/quarkus/components.properties";
private static final String DATA_FORMATS_CATALOG = "org/apache/camel/catalog/quarkus/dataformats.properties";
private static final String LANGUAGE_CATALOG = "org/apache/camel/catalog/quarkus/languages.properties";
private static final String TRANSFORMER_CATALOG = "org/apache/camel/catalog/quarkus/transformers.properties";
private static final String OTHER_CATALOG = "org/apache/camel/catalog/quarkus/others.properties";

private CamelCatalog camelCatalog;
Expand Down Expand Up @@ -83,6 +85,11 @@ public String getLanguageJSonSchemaDirectory() {
return LANGUAGE_DIR;
}

@Override
public String getTransformerJSonSchemaDirectory() {
return TRANSFORMER_DIR;
}

@Override
public String getOtherJSonSchemaDirectory() {
return OTHER_DIR;
Expand Down Expand Up @@ -130,6 +137,20 @@ public List<String> findLanguageNames() {
return names;
}

@Override
public List<String> findTransformerNames() {
List<String> names = new ArrayList<>();
InputStream is = camelCatalog.getVersionManager().getResourceAsStream(TRANSFORMER_CATALOG);
if (is != null) {
try {
CatalogHelper.loadLines(is, names);
} catch (IOException e) {
// ignore
}
}
return names;
}

@Override
public List<String> findOtherNames() {
List<String> names = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,16 @@ public void testFindOtherNames() throws Exception {
assertFalse(names.contains("blueprint"));
}

@Test
public void testFindTransformers() throws Exception {
List<String> names = catalog.findTransformerNames();

assertNotNull(names);
assertFalse(names.isEmpty());

assertTrue(names.contains("azure-storage-blob:application-cloudevents"));
}

@Test
public void testComponentArtifactId() throws Exception {
String json = catalog.componentJSonSchema("salesforce");
Expand Down
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ asciidoc:
requires: "'util=camel-website-util,quarkus=xref:js/quarkus.js'"

# Project versions
camel-version: 4.4.0 # replace ${camel.version}
camel-version: 4.5.0-SNAPSHOT # replace ${camel.version}
camel-docs-version: 4.4.x
camel-quarkus-version: 3.9.0 # replace ${camel-quarkus.version}
quarkus-version: 3.8.1 # replace ${quarkus.version}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ cqDeprecated: false
cqJvmSince: 1.8.0
cqNativeSince: n/a
cqCamelPartName: azure-storage-datalake
cqCamelPartTitle: Azure Storage Datalake Service
cqCamelPartDescription: Sends and receives files to/from Azure DataLake Storage.
cqCamelPartTitle: Azure Storage Data Lake Service
cqCamelPartDescription: Sends and receives files to/from Azure Data Lake Storage.
cqExtensionPageTitle: Azure storage datalake service
2 changes: 1 addition & 1 deletion docs/modules/ROOT/examples/components/jslt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ cqJvmSince: 1.1.0
cqNativeSince: 1.4.0
cqCamelPartName: jslt
cqCamelPartTitle: JSLT
cqCamelPartDescription: Query or transform JSON payloads using an JSLT.
cqCamelPartDescription: Query or transform JSON payloads using JSLT.
cqExtensionPageTitle: JSLT
2 changes: 1 addition & 1 deletion docs/modules/ROOT/examples/components/rest-openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ cqJvmSince: 1.0.0
cqNativeSince: 1.0.0
cqCamelPartName: rest-openapi
cqCamelPartTitle: REST OpenApi
cqCamelPartDescription: Configure REST producers based on an OpenAPI specification document delegating to a component implementing the RestProducerFactory interface.
cqCamelPartDescription: To call REST services using OpenAPI specification as contract.
cqExtensionPageTitle: REST OpenApi
2 changes: 1 addition & 1 deletion docs/modules/ROOT/examples/components/splunk-hec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ cqJvmSince: 1.1.0
cqNativeSince: 3.8.0
cqCamelPartName: splunk-hec
cqCamelPartTitle: Splunk HEC
cqCamelPartDescription: The splunk component allows to publish events in Splunk using the HTTP Event Collector.
cqCamelPartDescription: The splunk component allows publishing events in Splunk using the HTTP Event Collector.
cqExtensionPageTitle: Splunk HEC
2 changes: 1 addition & 1 deletion docs/modules/ROOT/examples/components/spring-rabbitmq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ cqJvmSince: 1.7.0
cqNativeSince: 1.7.0
cqCamelPartName: spring-rabbitmq
cqCamelPartTitle: Spring RabbitMQ
cqCamelPartDescription: Send and receive messages from RabbitMQ using Spring RabbitMQ client.
cqCamelPartDescription: Send and receive messages from RabbitMQ using the Spring RabbitMQ client.
cqExtensionPageTitle: Spring RabbitMQ
2 changes: 1 addition & 1 deletion docs/modules/ROOT/examples/components/stomp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ cqJvmSince: 1.1.0
cqNativeSince: n/a
cqCamelPartName: stomp
cqCamelPartTitle: Stomp
cqCamelPartDescription: Send and rececive messages to/from STOMP (Simple Text Oriented Messaging Protocol) compliant message brokers.
cqCamelPartDescription: Send and receive messages to/from STOMP (Simple Text Oriented Messaging Protocol) compliant message brokers.
cqExtensionPageTitle: Stomp
2 changes: 1 addition & 1 deletion docs/modules/ROOT/examples/components/telegram.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ cqJvmSince: 1.0.0
cqNativeSince: 1.0.0
cqCamelPartName: telegram
cqCamelPartTitle: Telegram
cqCamelPartDescription: Send and receive messages acting as a Telegram Bot Telegram Bot API.
cqCamelPartDescription: Send and receive messages using the Telegram Bot API.
cqExtensionPageTitle: Telegram
4 changes: 2 additions & 2 deletions docs/modules/ROOT/examples/components/wordpress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ cqDeprecated: false
cqJvmSince: 1.1.0
cqNativeSince: n/a
cqCamelPartName: wordpress
cqCamelPartTitle: Wordpress
cqCamelPartDescription: Manage posts and users using Wordpress API.
cqCamelPartTitle: WordPress
cqCamelPartDescription: Manage posts and users using the WordPress API.
cqExtensionPageTitle: Wordpress
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Camel Azure Datalake Gen2 Component
[id="extensions-azure-storage-datalake-whats-inside"]
== What's inside

* xref:{cq-camel-components}::azure-storage-datalake-component.adoc[Azure Storage Datalake Service component], URI syntax: `azure-storage-datalake:accountName/fileSystemName`
* xref:{cq-camel-components}::azure-storage-datalake-component.adoc[Azure Storage Data Lake Service component], URI syntax: `azure-storage-datalake:accountName/fileSystemName`

Please refer to the above link for usage and configuration details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Configure REST producers based on an OpenAPI specification document delegating to a component implementing the RestProducerFactory interface.
:cq-description: To call REST services using OpenAPI specification as contract.
:cq-deprecated: false
:cq-jvm-since: 1.0.0
:cq-native-since: 1.0.0
Expand All @@ -18,7 +18,7 @@ ifeval::[{doc-show-badges} == true]
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.0.0##
endif::[]

Configure REST producers based on an OpenAPI specification document delegating to a component implementing the RestProducerFactory interface.
To call REST services using OpenAPI specification as contract.

[id="extensions-rest-openapi-whats-inside"]
== What's inside
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/reference/extensions/telegram.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Send and receive messages acting as a Telegram Bot Telegram Bot API.
:cq-description: Send and receive messages using the Telegram Bot API.
:cq-deprecated: false
:cq-jvm-since: 1.0.0
:cq-native-since: 1.0.0
Expand All @@ -18,7 +18,7 @@ ifeval::[{doc-show-badges} == true]
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.0.0##
endif::[]

Send and receive messages acting as a Telegram Bot Telegram Bot API.
Send and receive messages using the Telegram Bot API.

[id="extensions-telegram-whats-inside"]
== What's inside
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Manage posts and users using Wordpress API.
[id="extensions-wordpress-whats-inside"]
== What's inside

* xref:{cq-camel-components}::wordpress-component.adoc[Wordpress component], URI syntax: `wordpress:operation`
* xref:{cq-camel-components}::wordpress-component.adoc[WordPress component], URI syntax: `wordpress:operation`

Please refer to the above link for usage and configuration details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ public String getLanguageJSonSchema(String name) {
return resolveJsonSchema("language", name);
}

@Override
public String getTransformerJSonSchema(String name) {
throw new UnsupportedOperationException("Transformer JSON schema resolution is not supported");
}

@Override
public String getOtherJSonSchema(String name) {
throw new UnsupportedOperationException("Other JSON schema resolution is not supported");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.apache.camel.ExtendedCamelContext;
import org.apache.camel.RouteConfigurationsBuilder;
import org.apache.camel.RoutesBuilder;
import org.apache.camel.TypeConverter;
import org.apache.camel.builder.LambdaRouteBuilder;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.builder.endpoint.EndpointRouteBuilder;
Expand Down Expand Up @@ -82,9 +81,6 @@ public RuntimeValue<CamelContext> createContext(
TypeConverterRegistry typeConverterRegistryValue = typeConverterRegistry.getValue();
typeConverterRegistryValue.setInjector(new FastTypeConverterInjector(context));
context.setTypeConverterRegistry(typeConverterRegistryValue);
if (typeConverterRegistryValue instanceof TypeConverter) {
context.setTypeConverter((TypeConverter) typeConverterRegistryValue);
}
context.setLoadTypeConverters(false);

extendedCamelContext.addContextPlugin(ModelJAXBContextFactory.class, contextFactory.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ public String getComponentParameterJsonSchema(String componentName) throws IOExc
if (instance != null) {
clazz = instance.getClass();
} else {
clazz = getFactoryFinder(DefaultComponentResolver.RESOURCE_PATH).findClass(componentName).orElse(null);
clazz = getCamelContextExtension().getFactoryFinder(DefaultComponentResolver.RESOURCE_PATH).findClass(componentName)
.orElse(null);
if (clazz == null) {
instance = hasComponent(componentName);
if (instance != null) {
Expand All @@ -230,7 +231,8 @@ public String getDataFormatParameterJsonSchema(String dataFormatName) throws IOE
if (instance != null) {
clazz = instance.getClass();
} else {
clazz = getFactoryFinder(DefaultDataFormatResolver.DATAFORMAT_RESOURCE_PATH).findClass(dataFormatName).orElse(null);
clazz = getCamelContextExtension().getFactoryFinder(DefaultDataFormatResolver.DATAFORMAT_RESOURCE_PATH)
.findClass(dataFormatName).orElse(null);
if (clazz == null) {
return null;
}
Expand All @@ -247,7 +249,8 @@ public String getLanguageParameterJsonSchema(String languageName) throws IOExcep
if (instance != null) {
clazz = instance.getClass();
} else {
clazz = getFactoryFinder(DefaultLanguageResolver.LANGUAGE_RESOURCE_PATH).findClass(languageName).orElse(null);
clazz = getCamelContextExtension().getFactoryFinder(DefaultLanguageResolver.LANGUAGE_RESOURCE_PATH)
.findClass(languageName).orElse(null);
if (clazz == null) {
return null;
}
Expand All @@ -257,7 +260,7 @@ public String getLanguageParameterJsonSchema(String languageName) throws IOExcep
}

private String getJsonSchema(String packageName, String name) throws IOException {
String path = packageName.replace('.', '/') + "/" + name + ".json";
String path = "META-INF/" + packageName.replace('.', '/') + "/" + name + ".json";
InputStream inputStream = getClassResolver().loadResourceAsStream(path);

if (inputStream != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected ProducerTemplate findOrCreateCamelTemplate() {
@Override
protected CamelContext createCamelContext() {
DefaultCamelContext ctx = new DefaultCamelContext(false);
ctx.setName(getAppName());
ctx.getCamelContextExtension().setName(getAppName());
ctx.setInjector(new DryModeInjector(ctx.getInjector()));

ExtendedCamelContext extendedCamelContext = ctx.getCamelContextExtension();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import jakarta.enterprise.context.ApplicationScoped;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.dataformat.avro.AvroDataFormat;
import org.apache.camel.model.dataformat.AvroLibrary;

import static org.apache.camel.quarkus.component.avro.it.AvroSchemaLoader.getSchema;

Expand All @@ -29,15 +30,15 @@ public class AvroRoute extends RouteBuilder {
@Override
public void configure() {

from("direct:marshalUsingBuildTimeGeneratedClass").marshal().avro(Admin.class);
from("direct:unmarshalUsingBuildTimeGeneratedClass").unmarshal().avro(Admin.class);
from("direct:marshalUsingBuildTimeGeneratedClass").marshal().avro(AvroLibrary.ApacheAvro, Admin.class);
from("direct:unmarshalUsingBuildTimeGeneratedClass").unmarshal().avro(AvroLibrary.ApacheAvro, Admin.class);

AvroDataFormat configureTimeAvroDataFormat = new AvroDataFormat(getSchema());
from("direct:marshalUsingConfigureTimeAvroDataFormat").marshal(configureTimeAvroDataFormat);
from("direct:unmarshalUsingConfigureTimeAvroDataFormat").unmarshal(configureTimeAvroDataFormat);

from("direct:marshalUsingAvroDsl").marshal().avro();
from("direct:unmarshalUsingInstanceClassNameAvroDsl").unmarshal().avro(Value.class.getName());
from("direct:unmarshalUsingSchemaAvroDsl").unmarshal().avro(Value.SCHEMA$);
from("direct:marshalUsingAvroDsl").marshal().avro(AvroLibrary.ApacheAvro);
from("direct:unmarshalUsingInstanceClassNameAvroDsl").unmarshal().avro(AvroLibrary.ApacheAvro, Value.class.getName());
from("direct:unmarshalUsingSchemaAvroDsl").unmarshal().avro(AvroLibrary.ApacheAvro, Value.SCHEMA$);
}
}
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.camel</groupId>
<artifactId>camel-dependencies</artifactId>
<version>4.4.0</version>
<version>4.5.0-SNAPSHOT</version>
</parent>

<groupId>org.apache.camel.quarkus</groupId>
Expand All @@ -39,8 +39,8 @@
<properties>

<!-- Primary dependencies - maintained manually -->
<camel.major.minor>4.4</camel.major.minor> <!-- run after each change: cd docs && mvnd validate -->
<camel.version>${camel.major.minor}.0</camel.version>
<camel.major.minor>4.5</camel.major.minor> <!-- run after each change: cd docs && mvnd validate -->
<camel.version>${camel.major.minor}.0-SNAPSHOT</camel.version>
<camel.docs.components.version>${camel.major.minor}.x</camel.docs.components.version><!-- the version in Camel's docs/components/antora.yml -->
<camel.docs.components.xref>${camel.docs.components.version}@components</camel.docs.components.xref><!-- the version in Camel's docs/components/antora.yml -->
<camel.docs.branch>camel-${camel.major.minor}.x</camel.docs.branch><!-- The stable camel branch on which our Antora docs depends -->
Expand Down Expand Up @@ -78,8 +78,8 @@
<assertj.version>3.25.1</assertj.version><!-- @sync io.quarkus:quarkus-build-parent:${quarkus.version} prop:assertj.version -->
<aws-java-sdk.version>1.11.714</aws-java-sdk.version>
<azure-sdk-bom.version>${azure-sdk-bom-version}</azure-sdk-bom.version>
<azure-core.version>1.45.1</azure-core.version><!-- @sync com.azure:azure-sdk-bom:${azure-sdk-bom.version} dep:com.azure:azure-core -->
<azure-identity.version>1.11.1</azure-identity.version><!-- @sync com.azure:azure-sdk-bom:${azure-sdk-bom.version} dep:com.azure:azure-identity -->
<azure-core.version>1.46.0</azure-core.version><!-- @sync com.azure:azure-sdk-bom:${azure-sdk-bom.version} dep:com.azure:azure-core -->
<azure-identity.version>1.11.2</azure-identity.version><!-- @sync com.azure:azure-sdk-bom:${azure-sdk-bom.version} dep:com.azure:azure-identity -->
<azure-core-http-vertx.version>1.0.0-beta.3</azure-core-http-vertx.version> <!-- TODO: https://github.com/apache/camel-quarkus/issues/4181 -->
<cassandra-driver-test.version>3.7.1</cassandra-driver-test.version><!-- Keep in sync with testcontainers instead of Debezium bom -->
<bouncycastle.version>1.77</bouncycastle.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.bouncycastle:bcprov-jdk18on -->
Expand All @@ -95,11 +95,11 @@
<freemarker.version>2.3.32</freemarker.version><!-- @sync io.quarkiverse.freemarker:quarkus-freemarker-parent:${quarkiverse-freemarker.version} prop:freemarker.version -->
<geny.version>0.6.2</geny.version>
<github-api.version>1.313</github-api.version><!-- Used in a Groovy script bellow -->
<google-auth-library.version>1.22.0</google-auth-library.version><!-- @sync com.google.cloud:google-cloud-pubsub:${google-cloud-pubsub.version} dep:com.google.auth:google-auth-library-oauth2-http -->
<google-auth-library.version>1.23.0</google-auth-library.version><!-- @sync com.google.cloud:google-cloud-pubsub:${google-cloud-pubsub.version} dep:com.google.auth:google-auth-library-oauth2-http -->
<google-oauth-client.version>${google-oauth-client-version}</google-oauth-client.version>
<google-cloud-bom.version>0.212.0</google-cloud-bom.version><!-- @sync com.google.cloud:libraries-bom:${google-cloud-bom-version} dep:com.google.cloud:google-cloud-bom -->
<google-cloud-pubsub-bom.version>1.126.2</google-cloud-pubsub-bom.version><!-- @sync com.google.cloud:google-cloud-bom:${google-cloud-bom.version} dep:com.google.cloud:google-cloud-pubsub-bom -->
<google-cloud-pubsub.version>1.126.2</google-cloud-pubsub.version><!-- @sync com.google.cloud:google-cloud-pubsub-bom:${google-cloud-pubsub-bom.version} dep:com.google.cloud:google-cloud-pubsub -->
<google-cloud-bom.version>0.214.0</google-cloud-bom.version><!-- @sync com.google.cloud:libraries-bom:${google-cloud-bom-version} dep:com.google.cloud:google-cloud-bom -->
<google-cloud-pubsub-bom.version>1.126.6</google-cloud-pubsub-bom.version><!-- @sync com.google.cloud:google-cloud-bom:${google-cloud-bom.version} dep:com.google.cloud:google-cloud-pubsub-bom -->
<google-cloud-pubsub.version>1.126.6</google-cloud-pubsub.version><!-- @sync com.google.cloud:google-cloud-pubsub-bom:${google-cloud-pubsub-bom.version} dep:com.google.cloud:google-cloud-pubsub -->
<graalvm.version>23.0.1</graalvm.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.graalvm.sdk:graal-sdk -->
<graalvm-docs.version>jdk21</graalvm-docs.version><!-- @sync io.quarkus:quarkus-documentation:${quarkus.version} prop:graal-community.tag-for-documentation -->
<groovy.version>4.0.18</groovy.version><!-- @sync io.quarkiverse.groovy:quarkus-groovy-parent:${quarkiverse-groovy.version} prop:groovy.version -->
Expand Down
Loading

0 comments on commit a03b66f

Please sign in to comment.