Announcement Announcement Module
Collapse
No announcement yet.
Calling a method with parameter in service activator Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calling a method with parameter in service activator

    hi Everyone,

    I want to call a method with parameters in service activator .Consider the below code

    Code:
    <bean id="zipToMsrTranslator" class="in.translator.ZipTranslator" >
    <property name="importFilePath"        value="//import/Zip"></property>
    <property name="importFileUnzipPath"   value="//import/Unzip"></property>
    <property name="exportFilesPath"       value="//Export/FilesToExport"></property>
    <property name="exportFileZipPath"     value="//Export/ZippedFile"></property>
    </bean>
    
    <int:service-activator input-channel="replyChannel"  expression="@zipToMsrTranslator.translateInput(zipToMsrTranslator.importFilePath,zipToMsrTranslator.importFileUnzipPath)"></int:service-activator>
    I want to do somethis as above .Can anyone help (The above code throws an exception Field or property 'zipToMsrTranslator' cannot be found on object of type 'org.springframework.integration.message.GenericMe ssage')

  • #2
    How about using

    @zipToMsrTranslator.translateInput(@zipToMsrTranslator.importFilePath,@zipToMsrTranslator.importFileUnzipPath)
    in the expression?

    The reason @ is required is it needs to be evaluated to a bean defined in your application context. Try it out and let us know if it works

    Comment


    • #3
      Thanks amol it works fine

      Comment

      Working...
      X