Results 1 to 3 of 3

Thread: Calling a method with parameter in service activator

  1. #1

    Default 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. #2
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    213

    Default

    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

  3. #3

    Default

    Thanks amol it works fine

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •