From 18555484755be53e1ece27ee38801892316ab31a Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Thu, 21 May 2026 13:44:53 +0200 Subject: [PATCH] CAMEL-23575: camel-mongodb-gridfs - align Exchange header constant names with Camel naming convention (#23413) Renames the values of the Exchange header constants in GridFsConstants to follow the standard Camel naming convention used across the rest of the component catalog, bringing camel-mongodb-gridfs in line with the parent camel-mongodb component (MongoDbConstants.OPERATION_HEADER = "CamelMongoDbOperation"). The Java field names are unchanged so routes/code referencing the constants symbolically continue to work as-is: gridfs.operation -> CamelGridFsOperation gridfs.metadata -> CamelGridFsMetadata gridfs.chunksize -> CamelGridFsChunkSize gridfs.objectid -> CamelGridFsObjectId gridfs.fileid -> CamelGridFsFileId The cascading rename of the auto-generated Endpoint DSL accessors on GridFsHeaderNameBuilder is included (gridfsOperation() -> gridFsOperation(), etc.) along with the regenerated component catalog. The upgrade-guide entry for this change is added on the main branch (per the backport upgrade-guide policy). Consistent with the same alignment applied to camel-lucene (CAMEL-23509), camel-jgroups (CAMEL-23510), camel-jgroups-raft (CAMEL-23511), and camel-cxf (CAMEL-23526). Reported by Claude Code on behalf of Andrea Cosentino. (cherry picked from commit 8f0b1acfb89867bc28805d8281fa5c70192e2122) Signed-off-by: Andrea Cosentino --- .../catalog/components/mongodb-gridfs.json | 10 +++---- .../mongodb/gridfs/mongodb-gridfs.json | 10 +++---- .../mongodb/gridfs/GridFsConstants.java | 10 +++---- .../dsl/GridFsEndpointBuilderFactory.java | 30 +++++++++---------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/mongodb-gridfs.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/mongodb-gridfs.json index b90caa820528e..ba39721d7a7af 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/mongodb-gridfs.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/mongodb-gridfs.json @@ -35,11 +35,11 @@ "CamelFileName": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the file.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#FILE_NAME" }, "Content-Type": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The content type of the file.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#CONTENT_TYPE" }, "CamelFileNameProduced": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The file name produced.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#FILE_NAME_PRODUCED" }, - "gridfs.metadata": { "index": 6, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Any additional metadata stored along with the file in JSON format.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_METADATA" }, - "gridfs.operation": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_OPERATION" }, - "gridfs.chunksize": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The number of bytes per chunk for the uploaded file.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_CHUNKSIZE" }, - "gridfs.fileid": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.bson.types.ObjectId", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ObjectId of the file produced", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_FILE_ID_PRODUCED" }, - "gridfs.objectid": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.bson.types.ObjectId", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ObjectId of the file.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_OBJECT_ID" } + "CamelGridFsMetadata": { "index": 6, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Any additional metadata stored along with the file in JSON format.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_METADATA" }, + "CamelGridFsOperation": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_OPERATION" }, + "CamelGridFsChunkSize": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The number of bytes per chunk for the uploaded file.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_CHUNKSIZE" }, + "CamelGridFsFileId": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.bson.types.ObjectId", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ObjectId of the file produced", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_FILE_ID_PRODUCED" }, + "CamelGridFsObjectId": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.bson.types.ObjectId", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ObjectId of the file.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_OBJECT_ID" } }, "properties": { "connectionBean": { "index": 0, "kind": "path", "displayName": "Connection Bean", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of com.mongodb.client.MongoClient to use." }, diff --git a/components/camel-mongodb-gridfs/src/generated/resources/META-INF/org/apache/camel/component/mongodb/gridfs/mongodb-gridfs.json b/components/camel-mongodb-gridfs/src/generated/resources/META-INF/org/apache/camel/component/mongodb/gridfs/mongodb-gridfs.json index b90caa820528e..ba39721d7a7af 100644 --- a/components/camel-mongodb-gridfs/src/generated/resources/META-INF/org/apache/camel/component/mongodb/gridfs/mongodb-gridfs.json +++ b/components/camel-mongodb-gridfs/src/generated/resources/META-INF/org/apache/camel/component/mongodb/gridfs/mongodb-gridfs.json @@ -35,11 +35,11 @@ "CamelFileName": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the file.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#FILE_NAME" }, "Content-Type": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The content type of the file.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#CONTENT_TYPE" }, "CamelFileNameProduced": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The file name produced.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#FILE_NAME_PRODUCED" }, - "gridfs.metadata": { "index": 6, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Any additional metadata stored along with the file in JSON format.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_METADATA" }, - "gridfs.operation": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_OPERATION" }, - "gridfs.chunksize": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The number of bytes per chunk for the uploaded file.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_CHUNKSIZE" }, - "gridfs.fileid": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.bson.types.ObjectId", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ObjectId of the file produced", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_FILE_ID_PRODUCED" }, - "gridfs.objectid": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.bson.types.ObjectId", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ObjectId of the file.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_OBJECT_ID" } + "CamelGridFsMetadata": { "index": 6, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Any additional metadata stored along with the file in JSON format.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_METADATA" }, + "CamelGridFsOperation": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_OPERATION" }, + "CamelGridFsChunkSize": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The number of bytes per chunk for the uploaded file.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_CHUNKSIZE" }, + "CamelGridFsFileId": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.bson.types.ObjectId", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ObjectId of the file produced", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_FILE_ID_PRODUCED" }, + "CamelGridFsObjectId": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.bson.types.ObjectId", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ObjectId of the file.", "constantName": "org.apache.camel.component.mongodb.gridfs.GridFsConstants#GRIDFS_OBJECT_ID" } }, "properties": { "connectionBean": { "index": 0, "kind": "path", "displayName": "Connection Bean", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of com.mongodb.client.MongoClient to use." }, diff --git a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/mongodb/gridfs/GridFsConstants.java b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/mongodb/gridfs/GridFsConstants.java index f05dde5fd811a..674fa58a6207a 100644 --- a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/mongodb/gridfs/GridFsConstants.java +++ b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/mongodb/gridfs/GridFsConstants.java @@ -41,15 +41,15 @@ public final class GridFsConstants { public static final String GRIDFS_FILE_KEY_UPLOAD_DATE = "uploadDate"; public static final String PERSISTENT_TIMESTAMP_KEY = "timestamp"; @Metadata(description = "Any additional metadata stored along with the file in JSON format.", javaType = "String") - public static final String GRIDFS_METADATA = "gridfs.metadata"; + public static final String GRIDFS_METADATA = "CamelGridFsMetadata"; @Metadata(label = "producer", description = "The operation to perform.", javaType = "String") - public static final String GRIDFS_OPERATION = "gridfs.operation"; + public static final String GRIDFS_OPERATION = "CamelGridFsOperation"; @Metadata(label = "producer", description = "The number of bytes per chunk for the uploaded file.", javaType = "Integer") - public static final String GRIDFS_CHUNKSIZE = "gridfs.chunksize"; + public static final String GRIDFS_CHUNKSIZE = "CamelGridFsChunkSize"; @Metadata(label = "producer", description = "The ObjectId of the file produced", javaType = "org.bson.types.ObjectId") - public static final String GRIDFS_FILE_ID_PRODUCED = "gridfs.fileid"; + public static final String GRIDFS_FILE_ID_PRODUCED = "CamelGridFsFileId"; @Metadata(label = "producer", description = "The ObjectId of the file.", javaType = "org.bson.types.ObjectId") - public static final String GRIDFS_OBJECT_ID = "gridfs.objectid"; + public static final String GRIDFS_OBJECT_ID = "CamelGridFsObjectId"; private GridFsConstants() { } diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GridFsEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GridFsEndpointBuilderFactory.java index ab77c905474c2..20d3c62225a23 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GridFsEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GridFsEndpointBuilderFactory.java @@ -896,10 +896,10 @@ public String fileNameProduced() { * * Group: common * - * @return the name of the header {@code gridfs.metadata}. + * @return the name of the header {@code GridFsMetadata}. */ - public String gridfsMetadata() { - return "gridfs.metadata"; + public String gridFsMetadata() { + return "CamelGridFsMetadata"; } /** * The operation to perform. @@ -908,10 +908,10 @@ public String gridfsMetadata() { * * Group: producer * - * @return the name of the header {@code gridfs.operation}. + * @return the name of the header {@code GridFsOperation}. */ - public String gridfsOperation() { - return "gridfs.operation"; + public String gridFsOperation() { + return "CamelGridFsOperation"; } /** * The number of bytes per chunk for the uploaded file. @@ -920,10 +920,10 @@ public String gridfsOperation() { * * Group: producer * - * @return the name of the header {@code gridfs.chunksize}. + * @return the name of the header {@code GridFsChunkSize}. */ - public String gridfsChunksize() { - return "gridfs.chunksize"; + public String gridFsChunkSize() { + return "CamelGridFsChunkSize"; } /** * The ObjectId of the file produced. @@ -932,10 +932,10 @@ public String gridfsChunksize() { * * Group: producer * - * @return the name of the header {@code gridfs.fileid}. + * @return the name of the header {@code GridFsFileId}. */ - public String gridfsFileid() { - return "gridfs.fileid"; + public String gridFsFileId() { + return "CamelGridFsFileId"; } /** * The ObjectId of the file. @@ -944,10 +944,10 @@ public String gridfsFileid() { * * Group: producer * - * @return the name of the header {@code gridfs.objectid}. + * @return the name of the header {@code GridFsObjectId}. */ - public String gridfsObjectid() { - return "gridfs.objectid"; + public String gridFsObjectId() { + return "CamelGridFsObjectId"; } } static GridFsEndpointBuilder endpointBuilder(String componentName, String path) {