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

camel-grpc: Port validation should check if a port was specified

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 4.4.1, 4.5.0
    • camel-grpc
    • None
    • Unknown

    Description

      The gRPC docs are maybe a bit misleading because they state that the port part of the URI is mandatory.

      However, it's currently possible to omit it and you then end up with either a consumer started on a random port (because the port int has the default value of 0). Or a producer that tries to connect to the gRPC default port.

      So I propose to initialize the port with a default of -1 and fix up the validation logic as using isEmpty is not really appropriate in this case.

      https://github.com/apache/camel/blob/7c8e7414e31f3eab888c7fb539abc8e5b3a61d6b/components/camel-grpc/src/main/java/org/apache/camel/component/grpc/GrpcConsumer.java#L96

      Attachments

        Activity

          People

            jamesnetherton James Netherton
            jamesnetherton James Netherton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: