Skip to content

How to have connector output JSON String? #398

Closed
@aliadnani

Description

@aliadnani

Hi, I'm using the Camel Websocket Connecter to send data from a topic to a websocket. The data from the input topic is in Json/JsonSchema format.

The connector works for sending data to the websocket, but the data is in the format of Struct{key1=val1,key2=val2}

Is it possible to have the connector emit a JSON string like {"key1":"val1","key2": "val2"} instead?

The task config can be seen via CURL request below:

curl -X POST -H "Content-Type: application/json" \
    --data '{
        "name": "camel-sink3",
        "config": {
          "topics": "xxx",
          "value.converter": "io.confluent.connect.json.JsonSchemaConverter",
          "value.converter.schema.registry.url": "http:/xxx-cp-schema-registry:8081",
          "key.converter": "org.apache.kafka.connect.storage.StringConverter",
          "connector.class": "org.apache.camel.kafkaconnector.websocket.CamelWebsocketSinkConnector",  
          "camel.sink.path.host": "0.0.0.0",
          "camel.sink.path.port":"8084",
	  "camel.component.websocket.host":"0.0.0.0",
          "camel.component.websocket.port": "8084",
	  "camel.sink.path.resourceUri": "kstreams-windows-average",
          "camel.component.websocket.minThreads": "3",
          "camel.sink.endpoint.sendToAll": "true",
        }
      }' http://xxx:8083/connectors

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions