Posts

Showing posts from January, 2013

How to disable HTTP Keep-Alive connections for all out-going requests in WSO2 ESB

By default, WSO2 ESB establishes HTTP Keep-Alive connection with the back-end web service. However, in some cases, we want to close connections just after using them specially when back-end server does not properly support Keep-Alive connections . At individual proxy service or sequence level, you can add NO_KEEPALIVE property to disable Keep-Alive connection between ESB and backend web services. <property name="NO_KEEPALIVE" value="true" scope="axis2"/> However, if you want to disable Keep-Alive connections globally for all message mediations, the above property will not be the solution. In such cases, you can add the following parameter to ESB_HOME/repository/conf/nhttp.properties file. http.connection.disable.keepalive=1

JSON pass-through in WSO2 ESB

Image
JSON is a lightweight data exchange format used in many web applications. WSO2 ESB supports sending and receiving JSON messages out-of-the-box. Exposing a SOAP web service over JSON is explained under sample 440 in WSO2 ESB official documentation. This post is to summarize steps of invoking a pass-through proxy service which accepts JSON request, forwards it to a RESTful service and reply back with JSON response (JSON-in, JSON-out). Pre-requisite: Download and extract the binary distribution of WSO2 ESB-4.5.1 I will use WSO2 Application Server-5.0.1 to deploy RESTful backend web service. You can use any server as the backend. However, in order to follow the steps mentioned in this post, you should use WSO2 Application server. Step 1: First, we need to setup the backend web service.  We will deploy a JAX-RS based restful service which consumes and produces JSON messages. You can download this RESTful web service(jaxrs_basic.war) from here . Step 2: Start WSO2 Applica

TIP: How to view log statements generated by WSO2 ESB log mediator in System Logs UI?

When you use log mediator inside sequences and proxy services in WSO2 ESB , the logs are shown by default in wso2carbon.file which can be found in CARBON_HOME/repository/logs directory. The same logs are viewable from "System Logs" page in ESB management console. However, from ESB-4.5.X releases, you should do the following simple change in order to see these logs in "System Logs" UI in management console. Step 1 Open CARBON_HOME/repository/conf/axis2/axis2.xml Step 2 Uncomment the following element. <handler class="org.wso2.carbon.utils.logging.handler.TenantDomainSetter" name="TenantDomainSetter"> Now, restart the server. Send a request to ESB and see the logs in "System Logs" UI in management console.