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

camel-undertow: consumer thrown NPE when the body cannot be converted to ByteBuffer

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.24.0, 3.0.0
    • Component/s: camel-undertow
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Assuming we have a simple route like:

      from("undertow:http://localhost:{{port}}/incompatibleData")
          .transform().constant(Collections.singletonMap("key", "val"));
      

      This code will cause an NPE on UndertowConsumer because the body cannot be converted to a ByteBuffer [1], instead of an NPE we should use mandatoryConvertTo so the exception is more clear.

      [1] https://github.com/apache/camel/blob/master/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowConsumer.java#L156

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lb Luca Burgazzoli
                Reporter:
                lb Luca Burgazzoli
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m