Wednesday, May 25, 2016

[WSO2][ESB] Class mediator sample

Hi all,

Here I present sample class mediator which I used in JMS local transactions. You can download relevant dependency jars thorough following links:

Dependency jars:

  •  Synapse core - http://www.java2s.com/Code/JarDownload/synapse/synapse-core-2.1.0.jar.zip
  •  Apache axiom - http://www.java2s.com/Code/JarDownload/apache-axiom/apache-axiom-api-1.2.7.jar.zip 
 package org.wso2.carbon.mediator;  
 import org.apache.synapse.MessageContext;  
 import org.apache.synapse.mediators.AbstractMediator;  
 /**  
  * This class counting messages received and use as class mediator
  */  
 public class MessageCounterMediator extends AbstractMediator {  
     private static int MESSAGE_COUNT = 0;  
     public boolean mediate(MessageContext synCtx) {  
       MESSAGE_COUNT++;  
       synCtx.setProperty("MESSAGE_COUNT", MESSAGE_COUNT);  
       return true;  
     }  
 }  

For more information, refer https://docs.wso2.com/display/ESB470/Sample+380%3A+Writing+your+own+Custom+Mediation+in+Java

You can write own java classes and use them within WSO2 ESB. :) :)

1 comment:

  1. Casinos - Wooricasinos
    Casinos - The best casinos 프라그마틱슬롯 that accept US players at Wooricasinos. 할리우드 배우 노출 Learn more about the types of players 안전 토토 사이트 in 안전바카라사이트 the 코인갤러리 United States and their history.

    ReplyDelete