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

Avoid KeyAlreadyExistsException in ManagedTypeConverterRegistry.listTypeConverters()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.19.5, 2.20.3, 2.21.0
    • camel-core
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: