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

ChannelHandlerFactories.newDelimiterBasedFrameDecoder always strips delimiters

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.14.0
    • 2.15.0
    • camel-netty4
    • None
    • Novice

    Description

      The constructor of io.netty.handler.codec.DelimiterBasedFrameDecoder includes a boolean stripDelimiter parameter, which is always set to true by the ChannelHandlerFactories.newDelimiterBasedFrameDecoder method (both directly and within org.apache.camel.component.netty4.codec.DatagramPacketDelimiterDecoder, which delegates to DelimiterBasedFrameDecoder)

      This parameter needs to be set to false when the end-of-frame delimiter is part of the message (e.g., the closing tag of an XML document), and therefore must not be discarded.

      Suggested fix:

      • Add a new constructor to DatagramPacketDelimiterDecoder that includes the parameter, which is then passed through to the delegate DelimiterBasedFrameDecoder
      • Add a new method signature for ChannelHandlerFactories.newDelimiterBasedFrameDecoder that includes the parameter
      • refactor existing newDelimiterBasedFrameDecoder method to delegate to the new method

      Attachments

        Activity

          People

            njiang Willem Jiang
            mmindenhall Mark Mindenhall
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: