Showing posts with label hello world. Show all posts
Showing posts with label hello world. Show all posts
WSO2 ESB - HELLO WORLD - CLASS MEDIATION
WSO2 - ESB
I came across this thing recently, and generally as we developers do, I did some head banging.
Assuming that theory is not what you are looking for, this post will land you in the arena directly, with working demo, following the old school tradition - a 'Hello World' program 🙂.
This will be involving ESB 5.x.x, based on the online documentation it is too easy to proceed with the installation part, Fedora 24 or any other yummy UNIX flavor.
I suggest you to install ESB bundle with Eclipse Luna from the site, since the latest version available i.e. the one with Eclipse Mars, will throw lot of NPEs in the environment.
package abc;
import org.apache.synapse.MessageContext;
import org.apache.synapse.mediators.AbstractMediator;
public class MedTester extends AbstractMediator {
public boolean mediate(MessageContext context) {
// TODO Implement your mediation logic here
System.out.println("Wassup ??????? ");
return true;
}
}
Steps to follow ahead -
Upload the jar for the above class in wso2esb-5.x.x/repository/components/lib folder.
Start the analytics server then your core server.
Add a sequence with class mediator.
Make sure class is uploaded successfully.
Create an API for invoking your above sequence.
Hit the below url using curl command -
http://172.16.2.34:8280/helloContext/helloAPI
curl -X GET http://172.16.2.34:8280/helloContext/helloAPI/
Here you go! Enjoy the output. 🙂
Subscribe to:
Posts (Atom)
Featured post
Oracle SQL Scheduled Jobs - An Interesting Approach
Oracle SQL Scheduled Jobs A DB Scheduler is the best way to automate any backend database job. For instance, if you want to process the p...
-
How to use PayloadFactory Mediator As per the WSO2-ESB documentation of PayloadFactory Mediator, it is stated that this me...
-
Hello Buddies. This one is a simple javascript code written to get look and feel of a very basic racing game. The complete code is avai...
-
Hello Buddies. Trying a simple shooting game using mouse cursor and javascript. Complete code is available here - https:/...