Bug 971744

Summary: camel-file-binding not using provided transformer when java interface is used for composite
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Jiri Sedlacek <jsedlace>
Component: CamelAssignee: Keith Babo <kbabo>
Status: CLOSED NOTABUG QA Contact: Jiri Sedlacek <jsedlace>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: atangrin, oskutka, soa-p-jira
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-22 16:49:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jiri Sedlacek 2013-06-07 08:21:56 UTC
Description of problem:

I've got switchyard project: composite with one bean service, bean service java interface is promoted to composite service, file binding is configured. Service method takes my object as a parameter, I created and configured transformer from java.io.File to my object.

In GenericFileConverter.convertTo(Class<?>, Exchange, Object, TypeConverterRegistry), line 64, type converter should be found, but is not. 

Question: Camel type converters differ from switchyard transformers? Are there two registries for transformers, one for camel and one for switchyard?

Comment 1 Keith Babo 2013-06-19 13:25:14 UTC
Yes, there are two registries :

1) The camel converter registry is based on Java types and converts from one Java type to another.

2) The SY transformer registry which is based on type names, which are just string literals really.

Camel converters can be added to the SY transformer registry (we do this for a set of Camel converters already), but SY transformers do not necessarily map to Camel converters because type names do not have to be Java class names.

You can include your own Camel converter to handle this transformation or use a Java interface which is compatible with the type used by the File gateway and use a transformer to convert from that type to your domain object.