This documentation is for WSO2 Enterprise Service Bus version 4.8.0 . View documentation for the latest release.

All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
XML
XML
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
   <beans>
      <bean id="springtest" class="org.apache.synapse.mediators.spring.SpringTestBean" singleton="false">
         <property name="testProperty" value="100"/>
      </bean>
   </beans>

Also, you need to build the JAR file of the following Spring Bean class and place it in the <ESB_HOME>/repository/components/lib/ directory.

Code Block
languagejava
package org.apache.synapse.mediators.spring;

import org.apache.synapse.MessageContext;
import org.apache.synapse.mediators.AbstractMediator;

public class SpringTestBean extends AbstractMediator{
   private String testProperty;

   public void setTestProperty(String testProperty){
      this.testProperty = testProperty;
   }

   public boolean mediate(MessageContext mc) {
            // Do somthing useful..
            // Note the access to the Synapse Message context
            return true;
   }
}
Excerpt
hiddentrue

Description of the Spring Mediator in WSO2 ESB.

For more examples, see Mediating with Spring.