Skip to content

pulsar-sink invalid character handling #2249

@tincore

Description

@tincore

Thanks for all the great work.

Running

JBang version: 0.117.1
Camel JBang version: 4.8.0

I'm not sure if this is expected but it seems like having invalid characters in uri parameters could be a bit unintuitive. I'm not sure if this would be the case with all kamelets or just this one. I've checked pulsar component sources and I could not find anything odd there.

This works (pulsar component). RAW() has to be added otherwise "pulsar+ssl" is parsed as "pulsar ssl" which would be invalid.

        - to: pulsar:persistent://tenant1/namespace1/topic1?serviceUrl=RAW(pulsar+ssl://localhost:1234)

When using pulsar-sink the following snippet fails because serviceUrl seems to be parsed when used in the kamelet and then in the pulsar component.

        - to:
            uri: kamelet:pulsar-sink
            parameters:
              topicType: persistent
              tenant: mytenant
              topic: mytopic
              namespaceName: mynamespace
              serviceUrl: RAW(pulsar+ssl://localhost:1234)
Caused by: java.net.URISyntaxException: Illegal character in scheme name at index 6: pulsar ssl://localhost:1234

A workaround for this seems to be nesting RAW twice. Do you know if there is any other option?
To me this seems unintuitive because you would need to know the template nesting level in order to add enough RAWs in an attribute with 'invalid' characters.

        - to:
            uri: kamelet:pulsar-sink
            parameters:
              topicType: persistent
              tenant: mytenant
              topic: mytopic
              namespaceName: mynamespace
              serviceUrl: RAW(RAW(pulsar+ssl://localhost:1234))

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