Posts

Ballerina Composer — Tutorial (Part III — Services)

In most of the integration scenarios, you have the requirement of exposing a certain functionality to the outside world as a service. In such a scenario, you can achieve this requirement so much easily with Ballerina Service Definitions. It as simple as just dragging and dropping a service from the composer tool palette to start your service logic. Ballerina service encloses the Resources which contains the integration logic. You can add multiple resources to expose various functionalities as resources, and expose them as types of requests. A service can be consist with following artifacts ResourcesConnectors — Accessible by all the resources (Global to service scope)Variables — Accessible by all the resources (Global to service scope) Composing your first Service
Read More...

Ballerina Composer — Tutorial (Part II — Function Definitions)

With the first part of this tutorial series, you were provided with basic idea about the ballerina composer and how to use it for writing your integration flows. As you can remember we wrote a simple echo service which is similar to the echo service sample provided with the ballerina distribution. I’ll provide a detailed description about ballerina services in our next tutorial. In this tutorial let’s have a look at one of the top level ballerina language construct, Functions. We will be have a look at what a ballerina function is and how we can use them in a real world integration scenario to provide more flexibility to your integration scenario. What is a Ballerina Function
Read More...

Ballerina Composer — Flexible, powerful and Smartest ever graphical tool for composing your Ballerina Programs

Ballerina Programming Language

Ballerina is the next generation of general purpose programming languages which is concurrent, strongly typed mapped with both textual and graphical syntax. Ballerina is highly optimized to write programs to integrate with data sources, services, and network-connected APIs of all kinds. To get a more detailed insight about Ballerina (The Language for the the future of Integration :) ), refer ballerinalang.org. You can download and give it a swirl and you’ll feel how cool it is.

Ballerina Composer

Now it’s time to get your dance choreographed with some style. That’s where Ballerina Composer come to the action. Ballerina Composer provides you a greater flexibility on writing your Ballerina Program. Ballerina composer can be introduced as the best and the most strongest graphical representation of a programming language. Ballerina Composer covers each and every corner of the Ballerina Lang.

Read More...

Writing a Custom Message Builder for WSO2 ESB

In WSO2 ESB, when you write a certain mediation logic, a user can do various types of alterations to the message body, headers, etc. Also a user can just passthrough the incoming raw payload without any message processing inside ESB. In situations where the message processing is done, WSO2 ESB uses a universal payload format within ESB. This universal payload format is SOAP message format.

When ESB receives a certain payload, the raw payload is converted to SOAP message format before further processing the content. For this purpose we use Message Builders. Depending on the receiving message's content type, a particular message builder is selected at the run time, for building the message. 
By default bellow Message Builders are available in WSO2 ESB. SOAPBuilderMIMEBuilderMTOMBuilderApplicationXMLBuilderXFormURLEncodedBuilderBinaryRelayBuilderPlainTextBuilder For most of the message content types, these Builders can be used to build the message. If a particular user thinks that they…

Dynamically Selecting SOAP Message Elements in WSO2 ESB

Most recently I faced a requirement where I had to select elements dynamically from a SOAP response message which comes to WSO2 ESB. The use case is as follows.

I have a proxy service where I get a request from a client and let's say the request looks like following.

1: <Request> 2: <Values> 3: <value>2</value> 4: </Values> 5: </Request>
The value can be changed for each request. However when the request is sent to the backend server from ESB we get a response as following

1: <Response> 2: <Events> 3: <Event><TestEntry>Entry Val1</TestEntry></Event> 4: <Event><TestEntry>Entry Val2</TestEntry></Event> 5: <Event><TestEntry>Entry Val3</TestEntry></Event> 6: <Event><TestEntry>Entry Val4</TestEntry></Event> 7: <Event><TestEntry>Entry Val5<…

Working with WSO2 ESB Event Sink and WSO2 DAS

Image
In this post I am going to point out how to integrate WSO2 ESB and WSO2 DAS to send events from ESB to the DAS server. In order to achieve this I am going to use WSO2 ESB v4.9.0 and WSO2 DAS v 3.0.0. In wso2 ESB you can publish events through publish event mediator and event sinks. In order to achieve our task first we need to create an event receiver and an event stream at the DAS end. Also we create an event sink at the ESB end, and use publish event mediator to publish our event to the DAS’s event receiver.
Creating an event stream Log on to DAS server and navigate to streams section as follows.



You can add three types of attributes for the event. Payload data Attributes, Meta Data Attributes and correlation data attributes. In this post I am just using the payload data attributes only. Next persist the event stream.




Creating an Event Receiver Now we need to create an event receiver to receive the events we send from the ESB end. click on the Receivers tab and you will be navigated to t…

Enabling per car file Logging in WSO2 ESB 4.9.0

In WSO2 ESB you can deploy multiple ESB artifact with a car file. In WSO2 ESB 4.9.0 you can get logs identified specially for esb artifacts deployed from a car file. In order to enable this feature you can follow the following steps.


Locate the log4j.properties configuration file at CARBON_HOME/repository/conf directoryComment log4j.appender.CARBON_CONSOLE.layout=org.apache.log4j.PatternLayout entryAdd log4j.appender.CARBON_CONSOLE.layout=org.apache.synapse.AppenderWrapper entry instead
Supported artifact typesMQTT Inbound EndpointsProxy ServicesAPIsSequencesEndpointsInbound EndpointsVfs Inbound EndpointsHttp Inbound EndpointsHttps Inbound endpointsKafka inbound endpointsHL7 Inbound Endpoints