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

Avoid KeyAlreadyExistsException in ManagedTypeConverterRegistry.listTypeConverters()

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.19.5, 2.20.3, 2.21.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      There is a JMX operation on the TypeConverterRegisty to fetch a list of converters.

       

      The TabularData object that's returned is keyed on the 'from' type name and 'to' type name. This mostly works ok. But you could have multiple converters which handle the same 'from' and 'to' types. In this case a KeyAlreadyExistsException exception is thrown when adding CompositeData to TabularData.

       

      We could avoid this by using a simple 'index' field in the CompositeData ,which could just be a simple number we increment each time around the type converter list loop.

       

        Attachments

          Activity

            People

            • Assignee:
              jamesnetherton James Netherton
              Reporter:
              jamesnetherton James Netherton
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: