Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-4209

A @Filter annotated bean cannot be used as the wire tap selector

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 4.2.11
    • Fix Version/s: None
    • Component/s: Core

      Description

      I'm trying to define a wire-tap:

      <int:publish-subscribe-channel
      	<int:interceptors>
      		<int:wire-tap channel="myChannel"
      			selector="mySelector" />
      	</int:interceptors>
      </int:publish-subscribe-channel>
      

      where mySelector does not implement MessageSelector, but has a method annotated with @Filter. This causes the following exception to be thrown when the integration flow is initialised:

      [...]
      Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.integration.channel.interceptor.WireTap#2': Unsatisfied dependency expressed through constructor argument with index 1 of type [org.springframework.integration.core.MessageSelector]: Could not convert constructor argument value of type [com.example.MySelector] to required type [org.springframework.integration.core.MessageSelector]: Failed to convert value of type [com.example.MySelector] to required type [org.springframework.integration.core.MessageSelector]; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.example.MySelector] to required type [org.springframework.integration.core.MessageSelector]: no matching editors or conversion strategy found
      	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:724)
      	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1147)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1050)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
      	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
      	... 37 more
      

        Attachments

          Activity

            People

            Assignee:
            abilan Artem Bilan
            Reporter:
            mauromol Mauro Molinari
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: