org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type:

后端 未结 2 433
醉话见心
醉话见心 2021-01-23 09:40

I have multipart file in the first place and I want to send it to camel pipeline and save this file with original name.

my code:

@Autowired
ProducerTempl         


        
2条回答
  •  萌比男神i
    2021-01-23 10:19

    You have to add the service discovery file named TypeConverter in the META-INF directory.

    src\main\resources\META-INF\services\org\apache\camel\TypeConverter 
    

    This file contains the fully qualified name of the @Converter class.

    e.g

    mypackage.MultiPartFileToFileConvertor 
    

    Also see the example from Camel in action 2 in Github https://github.com/camelinaction/camelinaction2/tree/b6a43abf9e0d4ec4e3753ebd735bb3448f98194b/chapter3/converter .

    Also the book Chapter 3.6 explains how the discovery and loading of custom converters work in full detail.

提交回复
热议问题