Dhairya-007 opened a new pull request, #29709: URL: https://github.com/apache/camel/pull/29709
## Problem `camel-influxdb2` declares and documents two things that nothing reads: - the `retentionPolicy` endpoint option (`InfluxDb2Endpoint`, default `default`), and - the `camelInfluxDB.RetentionPolicy` header (`InfluxDb2Constants.RETENTION_POLICY`, carrying a `@Metadata` description). Across the whole module, the only references to either are their own declaration, getter and setter. `InfluxDb2Producer` never asks for them. A retention policy is an **InfluxDB 1.x** concept: its write API takes one per write, and `camel-influxdb` really does use it — ```java // camel-influxdb InfluxDbProducer String retentionPolicy = exchange.getIn().getHeader(InfluxDbConstants.RETENTION_POLICY_HEADER, String.class); ... connection.write(dataBaseName, retentionPolicy, p); ``` — while the InfluxDB 2.x write API this component calls has no such parameter. Retention is a property of the bucket. The header even kept the 1.x spelling, `camelInfluxDB.RetentionPolicy`, while every other header in this component is `CamelInfluxDB2…` (`CamelInfluxDB2MeasurementName`, `CamelInfluxDB2WritePrecision`, …). That is what gives the copy away. A user who sets either one gets no warning and no effect, and the option's default of `default` makes it look like a working setting. ## Fix Deprecate both with a `deprecationNote`, and say in the description that they are never read — the same treatment `camel-aws2-s3vectors` gave its unused `SIMILARITY_THRESHOLD`/`SIMILARITY_SCORE` headers and `camel-tensorflow-serving` gave its `target` header. Changed: - `InfluxDb2Endpoint` and `InfluxDb2Constants` — `@Deprecated` + `deprecationNote`, and a description that says what is going on. - `influxdb2.json` and its `camel-catalog` copy — `"deprecated": true` plus the note, for both the parameter and the header. The two files are byte-identical afterwards. - `InfluxDb2EndpointBuilderFactory` — `@Deprecated` and the re-wrapped javadoc. - `camel-4x-upgrade-guide-4_24.adoc` — the entry a deprecation takes, pointing users at the bucket's retention period. The generated files were updated by hand, since I cannot run maven here; I took the shape from the existing deprecated headers and re-wrapped the DSL javadoc at the generator's own width (69 characters of text at indent 9), checking first that the wrap reproduces the untouched lines. If the regen job still finds a difference I will take its patch. ## Tests No behaviour changes — the option and header did nothing before and do nothing now, they are only labelled honestly — so there is nothing new to assert. The existing `camel-influxdb2` tests cover the writes, which this does not touch. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
