Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-21311

NATS: Automatically added nats:// prefix in servers-parameter blocks the usage of NATS' built-in Websocket support

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.8.0
    • 4.9.0
    • camel-nats
    • None
    • Unknown

    Description

      The current code in NatsConfiguration.java adds the nats:// -prefix automatically to the server connection string:

              String prefix = "nats://";

      This causes issues, because NATS supports other protocols like Websockets, where the prefix is ws:// or wss:// instead of nats://

      Looking at the examples provided by NATS, the prefix is something that the user of the NATS should provide as it defines the protocol between the client and the server. For example: https://natsbyexample.com/examples/messaging/pub-sub/java

      I was wondering if the auto-prefixing could be removed but then that would be a breaking change.

      Maybe a new configuration parameter could be added for defining the prefix (the protocol) and that could default to nats:// like currently?

       

      Attachments

        Activity

          People

            acosentino Andrea Cosentino
            mikaelkoskinen Mikael Koskinen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: