You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Daniel Gredler (Created) (JIRA)" <ji...@apache.org> on 2011/11/23 03:50:39 UTC

[jira] [Created] (CAMEL-4704) Allow type converters to be specified as Spring beans

Allow type converters to be specified as Spring beans
-----------------------------------------------------

                 Key: CAMEL-4704
                 URL: https://issues.apache.org/jira/browse/CAMEL-4704
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
    Affects Versions: 2.8.2
            Reporter: Daniel Gredler
            Priority: Minor


There are many Camel configuration elements that are auto-discovered when they are configured as Spring beans (Tracer, InterceptStrategy, EventNotifier, PlatformTransactionManager, etc):

http://camel.apache.org/advanced-configuration-of-camelcontext-using-spring.html

However, instances of TypeConverter are not auto-discovered based on the Spring configuration (there is a different auto-discovery mechanism):

http://camel.apache.org/type-converter.html

A related JIRA ticket (requesting custom XML syntax) was marked "won't fix": CAMEL-1685.

I agree that the extra XML tag is not necessary. However, the omission of Spring bean auto-discovery seems to violate the principle of least surprise -- as a new Camel user, knowing that Camel auto-discovers Spring beans for other configuration elements, I was surprised to find that Camel didn't find my TypeConverter Spring bean.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4704) Allow type converters to be specified as Spring beans

Posted by "Daniel Gredler (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13155695#comment-13155695 ] 

Daniel Gredler commented on CAMEL-4704:
---------------------------------------

Here's another related bug, also marked "won't fix": CAMEL-3746

I've been looking at the code, and it appears that the change would involve a small tweak to AbstractCamelContextFactoryBean.afterPropertiesSet(), probably adding another small code block in the area where we already query the registry for event notifiers, endpoint strategies, intercept strategies and lifecycle strategies.
                
> Allow type converters to be specified as Spring beans
> -----------------------------------------------------
>
>                 Key: CAMEL-4704
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4704
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.8.2
>            Reporter: Daniel Gredler
>            Priority: Minor
>
> There are many Camel configuration elements that are auto-discovered when they are configured as Spring beans (Tracer, InterceptStrategy, EventNotifier, PlatformTransactionManager, etc):
> http://camel.apache.org/advanced-configuration-of-camelcontext-using-spring.html
> However, instances of TypeConverter are not auto-discovered based on the Spring configuration (there is a different auto-discovery mechanism):
> http://camel.apache.org/type-converter.html
> A related JIRA ticket (requesting custom XML syntax) was marked "won't fix": CAMEL-1685.
> I agree that the extra XML tag is not necessary. However, the omission of Spring bean auto-discovery seems to violate the principle of least surprise -- as a new Camel user, knowing that Camel auto-discovers Spring beans for other configuration elements, I was surprised to find that Camel didn't find my TypeConverter Spring bean.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4704) Allow type converters to be specified as Spring beans

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-4704:
-------------------------------

    Fix Version/s:     (was: Future)
                   3.0.0

This would require an API change to {{org.apache.camel.TypeConverter}} or the introduction of a new or extended interface. As the {{TypeConverter}} would need to provide methods for what it can convert from -> to.

Also the current API has 6+ methods. We should offer a simpler API / base class, so it's almost a one liner. 

An alternative is of course to allow an annotation based instead. But we cannot lookup in the registry based on all classes, and then scan for annotations. And thus a special interface would be required.

Maybe name it {{org.apache.camel.spi.AnnotationTypeConverter}}. And then people would need to implement this interface. Then for each method they can use the @TypeConverter annotation we already have.

Then they can declare their custom classes as <bean> type in the XML file.
                
> Allow type converters to be specified as Spring beans
> -----------------------------------------------------
>
>                 Key: CAMEL-4704
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4704
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core
>    Affects Versions: 2.8.2
>            Reporter: Daniel Gredler
>            Priority: Minor
>             Fix For: 3.0.0
>
>
> There are many Camel configuration elements that are auto-discovered when they are configured as Spring beans (Tracer, InterceptStrategy, EventNotifier, PlatformTransactionManager, etc):
> http://camel.apache.org/advanced-configuration-of-camelcontext-using-spring.html
> However, instances of TypeConverter are not auto-discovered based on the Spring configuration (there is a different auto-discovery mechanism):
> http://camel.apache.org/type-converter.html
> A related JIRA ticket (requesting custom XML syntax) was marked "won't fix": CAMEL-1685.
> I agree that the extra XML tag is not necessary. However, the omission of Spring bean auto-discovery seems to violate the principle of least surprise -- as a new Camel user, knowing that Camel auto-discovers Spring beans for other configuration elements, I was surprised to find that Camel didn't find my TypeConverter Spring bean.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CAMEL-4704) Allow type converters to be specified as Spring beans

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-4704:
-------------------------------

    Fix Version/s: Future
       Issue Type: New Feature  (was: Improvement)
    
> Allow type converters to be specified as Spring beans
> -----------------------------------------------------
>
>                 Key: CAMEL-4704
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4704
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core
>    Affects Versions: 2.8.2
>            Reporter: Daniel Gredler
>            Priority: Minor
>             Fix For: Future
>
>
> There are many Camel configuration elements that are auto-discovered when they are configured as Spring beans (Tracer, InterceptStrategy, EventNotifier, PlatformTransactionManager, etc):
> http://camel.apache.org/advanced-configuration-of-camelcontext-using-spring.html
> However, instances of TypeConverter are not auto-discovered based on the Spring configuration (there is a different auto-discovery mechanism):
> http://camel.apache.org/type-converter.html
> A related JIRA ticket (requesting custom XML syntax) was marked "won't fix": CAMEL-1685.
> I agree that the extra XML tag is not necessary. However, the omission of Spring bean auto-discovery seems to violate the principle of least surprise -- as a new Camel user, knowing that Camel auto-discovers Spring beans for other configuration elements, I was surprised to find that Camel didn't find my TypeConverter Spring bean.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira