andy-d2019 commented on issue #5135:
URL: https://github.com/apache/camel-k/issues/5135#issuecomment-1938485209
Sure, sorry for the late reply.
This is a basic correctly working integration:
```
---
# yamllint disable-line rule:line-length
# camel-k: language=yaml dependency="camel:influxdb"
trait=camel.runtime-version="3.6.0"
- beans:
- type: org.influxdb.InfluxDB
name: influxClient
factoryBean: org.influxdb.InfluxDBFactory
factoryMethod: connect
constructors:
0: '{{influx-url}}'
1: '{{influx-username}}'
2: '{{influx-password}}'
- route:
id: influx-writer
description: >
This route sends data to influxdb for testing purposes.
from:
uri: timer://write?repeatCount=1
steps:
- setHeader:
id: setInfluxQuery
description: >
Set the header 'influxQuery' to the query that should be
executed.
name: camelInfluxDB.query
simple: "SELECT * FROM assets"
- to:
id: retrieveAssetFromInfluxDb
description: >
Query the influxdb for assets.
uri: 'influxdb:influxClient'
parameters:
databaseName: "{{influx-database}}"
retentionPolicy: "{{influx-retentionpolicy}}"
operation: 'query'
- log:
id: logSuccess
loggingLevel: 'INFO'
message: '$simple{id}: Data has been retrieved from the
influxdb.'
```
And now a basic Kamelet and Pipe that lead to the aforemention error:
```
apiVersion: camel.apache.org/v1
kind: Kamelet
metadata:
name: influx-query-action
annotations:
trait.camel.apache.org/camel.runtime-version: 3.6.0
camel.apache.org/kamelet.support.level: "Stable"
camel.apache.org/catalog.version: "4.2.0"
camel.apache.org/kamelet.icon:
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE2LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEu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et.group: „company“
labels:
camel.apache.org/kamelet.type: "action"
# The name of the application.
app.kubernetes.io/name: influx-action
# The component within the architecture.
app.kubernetes.io/component: test
# The name of the higher level application this application is part of.
app.kubernetes.io/part-of: test
spec:
dependencies:
- "mvn:org.apache.camel:camel-influxdb:4.2.0"
dataTypes:
out:
default: json
types:
json:
mediaType: application/json
definition:
title: "Influx-Query-Action"
description: |-
This action retrieves assets from an influxDB.
type: object
required:
- influx-url
- influx-username
- influx-password
- influx-database
- influx-retentionpolicy
properties:
influx-url:
title: Address to locate the influxdb
example: http://localhost:8086
type: string
influx-database:
title: The database to query from
example: primary
type: string
influx-username:
title: The username used to access the influx db
example: testuser
type: string
influx-password:
title: The token used to access the influx db
example: asdwqe23
type: string
influx-retentionpolicy:
title: The retention policy applied to the influx db
example: autogen
type: string
template:
beans:
- type: org.influxdb.InfluxDB
name: influxClient
factoryBean: org.influxdb.InfluxDBFactory
factoryMethod: connect
constructors:
0: '{{influx-url}}'
1: '{{influx-username}}'
2: '{{influx-password}}'
from:
uri: "kamelet:source"
steps:
- to:
id: queryInfluxDb
description: >
Query the influx database.
uri: influxdb:influxClient
parameters:
query: "$simple{body}"
databaseName: "{{influx-database}}"
retentionPolicy: "{{influx-retentionpolicy}}"
operation: QUERY
- to: "log:info"
```
```
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: influx-action-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: influx-generator-source
properties:
query: "from(bucket:\"company\") |> range(start: 0)"
steps:
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: influx-query-action
properties:
influx-database: test
influx-url: "http://my-influxdb.test.svc.cluster.local:8086"
influx-username: "test"
influx-password: "test12345"
influx-retentionpolicy: "autogen"
sink:
uri: http://influx-service.test/queryresult
```
--
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]