From 2884da4ee5b9d531e1358186129f6a4eb56ac8b4 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Thu, 21 May 2026 11:50:06 +0200 Subject: [PATCH] CAMEL-23575: camel-mongodb-gridfs - align Exchange header constant names with Camel naming convention 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 4.21 upgrade-guide entry documents both the constant-value rename and the DSL-accessor rename for routes using the literal string keys or the fluent builder methods. 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. Signed-off-by: Andrea Cosentino --- .../catalog/components/mongodb-gridfs.json | 10 +++---- .../mongodb/gridfs/mongodb-gridfs.json | 10 +++---- .../mongodb/gridfs/GridFsConstants.java | 10 +++---- .../pages/camel-4x-upgrade-guide-4_21.adoc | 25 ++++++++++++++++ .../dsl/GridFsEndpointBuilderFactory.java | 30 +++++++++---------- 5 files changed, 55 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 aeca5c1c21c35..b1bb5ea6baa9a 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 aeca5c1c21c35..b1bb5ea6baa9a 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/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc index 698f970bc470e..fe7fd124871e7 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc @@ -668,6 +668,31 @@ for the embedded HTTP server: Both default to unset. When both are unset, JWT validation behaviour is unchanged (signature plus the default `exp` / `nbf` checks). +=== camel-mongodb-gridfs + +The Exchange header values exposed by `GridFsConstants` have been renamed to follow the standard +Camel naming convention, bringing `camel-mongodb-gridfs` in line with the parent `camel-mongodb` +component (`MongoDbConstants.OPERATION_HEADER = "CamelMongoDbOperation"`). The Java field names +are unchanged, so routes referencing the constants symbolically +(e.g. `GridFsConstants.GRIDFS_OPERATION`, `GridFsConstants.GRIDFS_OBJECT_ID`) continue to work +without modification. However, routes that set or read these headers using the raw string values +must be updated: + +* `gridfs.operation` -> `CamelGridFsOperation` +* `gridfs.metadata` -> `CamelGridFsMetadata` +* `gridfs.chunksize` -> `CamelGridFsChunkSize` +* `gridfs.objectid` -> `CamelGridFsObjectId` +* `gridfs.fileid` -> `CamelGridFsFileId` + +As a consequence, the generated Endpoint DSL header accessors on `GridFsHeaderNameBuilder` +have been renamed accordingly: + +* `gridfsOperation()` -> `gridFsOperation()` +* `gridfsMetadata()` -> `gridFsMetadata()` +* `gridfsChunksize()` -> `gridFsChunkSize()` +* `gridfsObjectid()` -> `gridFsObjectId()` +* `gridfsFileid()` -> `gridFsFileId()` + === Deprecation of camel-ironmq The component camel-ironmq is deprecated. The official library used has been unmaintained since 2017 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) {