Sunday, September 3, 2017

Call RPG calls from WSO2 ESB

If the question is How to call AS400 DB2 RPG calls from WSO2 ESB, then the answer is PCML connector. It is a very convenient way to call RPG calls, as it can be done by doing only few configurations, with zero code. The rest is handled by WSO2 ESB!!.

A bit about RPG

RPG stands for Report Program Generator, and it a high level programing language specific for IBM AS400, More on RPG.

PCML Connector
A complete guide is in WSO2 ESB Connector documentation.

In order to call an RPG there are only few steps.
1. Save .pcml file in the registry. This should contain the RPG library string and the parameters (both input and output). When the parameters are defined the parameter type, length should be matched as in IBM documentation. For an example, if the parameter is a String value then the type should be char and the length should be matched to the length of the String.
2. pcml.init config in the calling synapse config should be defined. Under that, the server ip, username, password should be defined
3. The payload factory mediator can be defined to pass the payload with the parameters.
4. The pcml.call config to configure the .pcml file location and to call the PCML connector to get the things done.


Thursday, August 3, 2017

Benefits of WSO2 ESB

WSO2 ESB is a cloud enabled, 100% open source integration solution which is a  standards-based messaging engine that provides the value of messaging without writing code. Instead of having your heterogeneous enterprise applications and systems, which are using various standards and protocols, communicate point-to-point with each other, you can simply integrated with WSO2 ESB, which handles transforming and routing the messages to the appropriate destinations.

It also compromises of
- data integration capabilities, eliminating the need to use a separate data services server for your integration processes.
- managing long-running, stateful business processes.
- analytics capabilities for comprehensive monitoring
- message brokering capabilities that can be used for reliable messaging
- capabilities to run microservices for your integration flows.

Other than those key features, some benefits of having WSO2 ESB are,
  • Enables communication among various heterogeneous applications and systems
  • 100% open source, lightweight, and high performance
  • Support for open standards such as REST, SOAP, WS-*
  • Support for domain specific solutions (SAP, FIX, HL7)
  • Support message format transformation 
  • Supports message routing 
  • Supports message enrichment
  • 160+ Connectors (A ready made tool that can be used to connect to public web APIs) such as Salesforce, JIRA, Twitter, LDAP, Facebook and more)
  • Supports wider range of integration scenarios, known as EIP patterns
  • Having Scalable and extensible architecture
  • Easy to configure and re-use, tooling support via Developer Studio, which is an eclipse based tool for artifact design
  • Equipped with ESB analytics, for real time monitoring

Find more on WSO2 ESB from:
http://wso2.com/library/articles/2017/07/what-is-wso2-esb/

Tuesday, May 23, 2017

WSO2 ESB Message Flow

WSO2 ESB is a lightweight open source and high performing ESB. It is built on Synpase, which acts as the mediation engine.

This blog post describes the message flow of ESB at the synapse level from the client to backend and then backend to client.

To trace the message flow we can deploy a proxy service and invoke that,

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="TestProxy"
       startOnLoad="true"
       statistics="disable"
       trace="disable"
       transports="https,http">
   <target>
      <inSequence>
         <log/>
         <send>
            <endpoint>
               <address uri="http://www.mocky.io/v2/5924085b100000771e003629"/>
            </endpoint>
         </send>
      </inSequence>
   </target>
   <description/>
</proxy>
           

When a request comes from the client side, at the synapse level, it first hits the receive method in ProxyServiceMessageReceiver. This is the message flow in the request flow,

In-Flow

               
org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive
at this level having the axis2 message context

org.apache.synapse.core.axis2.MessageContextCreatorForAxis2.getSynapseMessageContext 
get the synapse message context out of it

org.apache.synapse.core.axis2.ProxyService.registerFaultHandler
fault handler is registered for the proxy service

org.apache.synapse.mediators.base.SequenceMediator.mediate
call the mediate method in the in-sequence

org.apache.synapse.mediator.AbstractListMediator.mediate
iterates through mediators in the in-sequence

org.apache.synapse.mediators.builtin.SendMediator.mediate

org.apache.synapse.endpoints.AddressEndpoint.send

org.apache.synapse.core.axis2.Axis2Sender.sendOn

org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send


Out-Flow

 

org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive

org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage

org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage

org.apache.synapse.mediators.base.SequenceMediator.mediate()
call the mediate method in the out-sequence

org.apache.synapse.mediators.AbstractListMediator.mediate()
iterates through mediators in the out-sequence

org.apache.synapse.mediators.builtin.SendMediator.mediate()

org.apache.synapse.core.axis2.Axis2Sender.sendBack