Wednesday, January 30, 2013

ESB Performance 6.5



WSO2 ESB has released the latest 4.6.0 version.
The highlight for this release is making the the high performing pass-through transport to be the default transport. Now all mediation scenarios can be executed without having to switch transports to get best performance based on the scenario being run.
                   The article presents the latest performance study conducted by the WSO2 ESB team with the latest release of the WSO2 ESB - 4.6.0. The most significant performance enhancement in this release is making the Passthrough Transport to be the default transport. In this article the performance of a number of leading Open Source ESBs are compared and the improvements to the WSO2 ESB are discussed. The results show that the latest WSO2 ESB performs strongly compared to other Open Source ESBs.
Please review following link for more detail:
http://wso2.org/library/articles/2013/01/esb-performance-65  

Tuesday, January 29, 2013


Integrating WSO2 ESB and WSO2 Message Broker

We can integrate wso2 enterprise service bus and the wso2 message broker to satisfy the
message brokering needs of wso2 esb. Basically wso2 esb can use wso2 mb to implement
store and forward messaging pattern.

Using ESB for implementing store and forward message pattern can be done in two ways;

1. Using JMS endpoints and JMS proxy services
2. Using message stores and processors

Before implementing both of the above, we need to set up wso2 ESB and wso2 MB in our
deployment environment. When we setting up multiple wso2 products in the same host
it is not possible to start up all those products with their default configuration at the same time,
since with default configuration they are trying to use the same ports. Eg : HTTP, HTTPS..
So when setting up multiple wso2 products in the same machine we need to configure them to
run in different ports. We can easily configure it by changing the port offset value.

In this guide we are setting up WSO2 Message Broker with port offset 1 and WSO2 Enterprise
Service Bus with port offset 0.

Setting up WSO2 Message Broker

  • Download the MB 2.0.1 binary from following URL http://wso2.com/products/message-
  • broker/Unzip wso2mb-2.0.1.zip pack. We consider this unzipped folder as MB_HOME.
  • To configure the port offset, open <MB_HOME>/repository/conf/carbon.xml file and change the offset value to 1.

<Ports>
<!-- Ports offset. This entry will set the value of the ports defined below to
the define value + Offset.
e.g. Offset=2 and HTTPS port=9443 will set the effective HTTPS port to 9445
-->
<Offset>1</Offset>

In WSO2 Message Broker we are using cassandra server as the storage. We have
bundled the cassandra server with MB pack and by default MB uses that one. However
in production setups we recommend to use an external cassandra server. Users can find
information on setting up cassandra server externally from following URL.
http://docs.wso2.org/wiki/display/MB201/Installing+Apache+Cassandra


  • But here, we are going to use the embedded cassandra server. As we have change the

port offset by 1 in the above step , we will have to point MB to correct Cassandra port.

Open <MB_HOME>/repository/conf/advanced/qpid-virtualhosts.xml and edit it to the
correct port. In our case it will be 9161 ( Default 9160 + 1)

<store>
<class>org.wso2.andes.server.store.CassandraMessageStore</class>
<username>admin</username>
<password>admin</password>
<cluster>ClusterOne</cluster>
<idGenerator>org.wso2.andes.server.cluster.coordination.TimeStampBasedMessageId
Generator</idGenerator>
<connectionString>localhost:9161</connectionString>
</store>

Note:
If you are using an external Cassandra server, you need to point MB to it by editing the
value of the connection string above as required.


  • By default , the message batch size for browser subscriptions of MB 2.0.1 has

configured to a very low value like 2. We need to increase it to a large value by
changing configuration parameter. For that, you need to add the following parameter to
<MB_HOME>/repository/conf/advanced/qpid-config.xml

<messageBatchSizeForBrowserSubscriptions>100000</
messageBatchSizeForBrowserSubscriptions>

Note:- You can add the above parameter as a child of <broker> element in qpid-config.xml


  • Now navigate to <MB_HOME>/bin and run wso2server.sh file, and start WSO2 MB.


Setting up WSO2 ESB

Download the ESB 4.5.1 binary from following URL

  • http://wso2.com/products/enterprise-service-bus/
  • Unzip wso2esb-4.5.1.zip pack. We consider this unzipped folder as ESB_HOME.
  • We need to enable JMS transport of ESB to communicate with MB. For that you need to edit the axis2.xml file located in ESB_HOME/repository/conf/axis2 folder.


In this axis2.xml file , you can find a commented out transport receiver block for MB
2.x.x. You need to uncomment that block to integrate MB and ESB.

<!--Uncomment this and configure as appropriate for JMS transport support with WSO2
MB 2.x.x -->
<!--transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
…..
</parameter>
</transportReceiver-->

Apart from that you need to uncomment transport sender block for JMS also. It is in the
same axis2.xml file

<!-- uncomment this and configure to use connection pools for sending messages>
<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/--
>


  • Then copy required client libraries from MB to ESB. For that copy the following two jars

(from <MB_HOME>/clent-lib folder) to <ESB_HOME>/repository/components/lib folder

-andes-client-0.13.wso2v4
-geronimo-jms_1.1_spec-1.1.0.wso2v1

Open JNDI.properties file in <ESB_HOME>/repository/conf folder and point to the MB
broker being run. Also use ‘carbon’ as the virtualhost. Define a queue called ‘JMSMS’
there. No need of a topic here, so comment it out. But in order to avoid
getting ‘javax.naming.NameNotFoundException: TopicConnectionFactory’ during server
startup, point TopicConnectionFactory also to MB.


  • # register some connection factories

# connectionfactory.[jndiname] = [ConnectionURL]
connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/carbon?
brokerlist='tcp://localhost:5673'
connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientID/carbon?
brokerlist='tcp://localhost:5673'

# register some queues in JNDI using the form
# queue.[jndiName] = [physicalName]
queue.JMSMS=JMSMS
queue.StockQuotesQueue=StockQuotesQueue


  • Start WSO2 ESB by running <ESB_HOME>/bin/wso2server.sh file.


Now we have completed the setup of ESB. However we need to have some back-end services
to be available for testing the above mentioned scenarios. For that we need to run an ant task
for deploying the “SimpleStockQuoteService” in the simple axis2server we have.

Setting up back-end web service

Navigate to <ESB_HOME>/samples/axis2Server/src/SimpleStockQuoteService
and run ‘ant’ to build.
Come back to <ESB_HOME>/samples/axis2server folder and run
axis2Server.sh file.
Point your browser to http://127.0.0.1:9000/services/SimpleStockQuoteService?
wsdl and verify that the service is running.


  • Using JMS endpoints and JMS proxies


As we have explained before, we can integrate wso2 esb and wso2 mb with two ways. Here we
are explaining on how we can integrate them as JMS endpoints.

Use case :
Store a message received to a http proxy of esb in a jms queue. Consume that queue and get
the message and send to the actual endpoint.
We need to create the consumer first to make a subscription for the queue that we are going to
use in this scenario. For that we need to have a JMS proxy with the queue name we defined in
the jndi.properties file above.

There are multiple ways to create proxy services, sequences, endpoints, message stores and
processors etc.. in ESB management console. You can either use graphical wizards or just
copy and paste the following XML configurations into the source view. You can find the source
view under “Manage → Service Bus → Source View” in the left navigation pane in WSO2 ESB
management console.


  • Create a JMS Proxy with the name “StockQuotesQueue”. Synapse configuration for the

proxy would be as follows.

<proxy xmlns="http://ws.apache.org/ns/synapse" name="StockQuotesQueue"
transports="jms" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<log level="full"/>
<send>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
</send>
</inSequence>
</target>
<description></description>
</proxy>

Here we are logging the consumed message from the JMS queue “StockQuotesQueue”
and send it to the endpoint SimpleStockQuoteService.


  • Create the HTTP proxy to send message to the JMS Queue. Synapse configuration for this http proxy is as follows. Since this is a one way message we add the property “OUT_ONLY” true and we need to have “FORCE_SC_ACCEPTED” property to send a 202 response to the client who invoked this proxy.


<proxy xmlns="http://ws.apache.org/ns/synapse" name="StockQuoteProxy"
transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<send>
<endpoint>

<address uri="jms:/StockQuotesQueue?
transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.fact

ory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.
url=repository/conf/jndi.properties&transport.jms.DestinationType=queue"/>
</endpoint>
</send>
</inSequence>
</target>
<description></description>
</proxy>

Note:- Due to a bug in the ESB source view, you need to replace ‘&’ character of the
above JMS endpoint url by ‘&amp;’

Now we have completed the message flow paths. When the “StockQuoteProxy” is invoked,
it will send the message to the queue. Then that queue will be consumed by the JMS proxy
“StockQuotesQueue” and send it to the actual end point.

Testing


  • With soap UI send the following soap message to the StockQuoteProxy. The endpoint URL of the StockQuoteProxy can be found out in the service dashboard of StockQuoteProxy service. By clicking on “Manage → Services → List” in the left navigation pane, you can access the “Deployed Services” page which shows all proxy services deployed in ESB. You can access the service dashboard of StockQuoteProxy by clicking on the service name. In there, you will find the endpoints of proxy service.

e.g:- http://localhost:8280/services/StockQuoteProxy

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd">
<soap:Header/>
<soap:Body>
<ser:placeOrder>
<!--Optional:-->
<ser:order>
<!--Optional:-->
<xsd:price>10</xsd:price>
<!--Optional:-->
<xsd:quantity>100</xsd:quantity>
<!--Optional:-->
<xsd:symbol>IBM</xsd:symbol>
</ser:order>
</ser:placeOrder>
</soap:Body>

</soap:Envelope>

As the out put, this message will be logged at ESB console and SimpleAxis2Server’s log will be
as follows;

Tue Jan 15 15:31:28 IST 2013 samples.services.SimpleStockQuoteService :: Accepted order
#2 for : 100 stocks of IBM at $ 10.0

Using message stores and processors

Define a message Store by copy-pasting following config to the source view
(Alternatively you can use message-store UI).

<messageStore name="JMSMS"
class="org.wso2.carbon.message.store.persistence.jms.JMSMessageStore"
xmlns="http://ws.apache.org/ns/synapse">

<parameter
name="java.naming.factory.initial">org.wso2.andes.jndi.PropertiesFileInitialContextF
actory</parameter>
<parameter name="java.naming.provider.url">repository/conf/jndi.properties</
parameter>
<parameter name="store.jms.destination">JMSMS</parameter>
<parameter name="store.jms.JMSSpecVersion">1.1</parameter>
<parameter name="store.jms.cache.connection">false</parameter>
</messageStore>


  • Define an end-point to send the message. In this example we use above backend we just set-up.


<endpoint name="SimpleStockQuoteService">
<address uri="http://127.0.0.1:9000/services/SimpleStockQuoteService"/>
</endpoint>


  • Define a message forwarding processor as below (by copy-pasting or using the Management Console UI).


<messageProcessor
class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardin
gProcessor"
name="Processor1"

messageStore="JMSMS">
<parameter name="max.delivery.attempts">4</parameter>
<parameter name="interval">4000</parameter>
</messageProcessor>


  • Now to test the scenario use a proxy service like below.


<proxy name="InOnlyProxy"
transports="https http"
startOnLoad="true"
trace="disable">
<target>
<inSequence>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<property name="OUT_ONLY" value="true"/>
<property name="target.endpoint" value="SimpleStockQuoteService"/>
<log level="full"/>
<store messageStore="JMSMS"/>
</inSequence>
</target>
</proxy>

Note the highlighted parts, which are related.
Now whenever a message comes to this proxy service, it will be stored in JMS message store
(which is in MB, JMSMS queue. If you disable message processor and send messages you will
notice in MB management console message count of JMSMS queue being increased.)
This is “In Only” service invocation with Message Forwarding Processor.

Similarly, you can follow the following artile to implement the others.

http://wso2.org/library/articles/2011/12/implementing-store-forward-messaging-patterns-wso2esb-part-2

Testing


  • With soap UI send the following soap message to the InOnlyProxy.


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd">
<soapenv:Header/>

<soapenv:Body>
<ser:getQuote>
<!--Optional:-->
<ser:request>
<!--Optional:-->
<xsd:symbol>IBM</xsd:symbol>
</ser:request>
</ser:getQuote>
</soapenv:Body>
</soapenv:Envelope>


  • Message will be logged at ESB console, SOAP UI will get 202 Accepted message, and at axis2Server console following will be logged. 
                samples.services.SimpleStockQuoteService :: Generating quote for : IBM

Adapt to Your Environment


  • replace

<endpoint name="SimpleStockQuoteService">
<address uri="http://test"/>
</endpoint>
and use a suitable name.

So using both of the above ways , It is possible to integrate wso2 Message Broker and wso2
Enterprise Service Bus.

The WSO2 Enterprise Service Bus (ESB) 4.6.0 Released! (FASTER.........)

WSO2 ESB team is pleased to announce the release of version 4.6.0 of the Open Source Enterprise Service Bus (ESB).
WSO2 ESB is a fast, lightweight and user friendly open source Enterprise Service Bus (ESB) distributed under the Apache Software License v2.0. WSO2 ESB allows system administrators and developers to easily configure message routing, intermediation, transformation, logging, task scheduling, fail over routing and load balancing. It also supports transport switching, eventing, rule based mediation and priority based mediation for advanced integration requirements. The ESB runtime is designed to be completely asynchronous, non-blocking and streaming based on the Apache Synapse mediation engine.
WSO2 ESB 4.6.0 is developed on top of the revolutionary WSO2 Carbon platform (Middleware a' la carte), an OSGi based framework that provides seamless modularity to your SOA via componentization. This release also contains many new features and a range of optional components (add-ons) that can be installed to customize the behavior of the ESB. Further, any existing features of the ESB which are not required to your environment can be easily removed using the underlying provisioning framework of Carbon. In brief, WSO2 ESB can be fully customized and tailored to meet your exact SOA needs.
You can download this distribution from http://wso2.com/products/enterprise-service-bus/ and give it a try.

How to Run

  1. Extract the downloaded zip
  2. Go to the bin directory in the extracted folder
  3. Run the wso2server.sh or wso2server.bat as appropriate
  4. Point your browser to the URL https://localhost:9443/carbon
  5. Use "admin", "admin" as the username and password to login as an admin
  6. If you need to start the OSGi console with the server use the property -DosgiConsole when starting the server. The INSTALL.txt file found on the installation directory will give you a comprehensive set of options and properties that can be passed into the startup script
  7. Sample configurations can be started by the wso2esb-samples script passing the sample number with the -sn option (Please have a look at the samples guide for more information, on running samples)

Enhancements in WSO2 ESB 4.6.0

  • PassThrough HTTP transport support for all mediation scenarios
  • FastXSLT mediator for high performance XSLT transformations
  • Improved XPATH performance

Key Features of WSO2 ESB

  • Proxy services - facilitating synchronous/asynchronous transport, interface (WSDL/Schema/Policy), message format (SOAP 1.1/1.2, POX/REST, Text, Binary), QoS (WS-Addressing/WS-Security/WS-RM) and optimization switching (MTOM/SwA).
  • API facilitating building REST services
  • Non-blocking HTTP/S transports based on Apache HttpCore-NIO for ultra-fast execution and support for thousands of connections at high concurrency with constant memory usage.
  • Built in Registry/Repository, facilitating dynamic updating and reloading of the configuration and associated resources (e.g. XSLTs, XSD, WSDL, Policies, JS configurations ..)
  • Easily extendable via custom Java classes (mediator and command)/Spring configurations, or BSF Scripting languages (Javascript, Ruby, Groovy, etc.)
  • Built in support for scheduling tasks using the Quartz scheduler.
  • Load-balancing (with or without sticky sessions)/Fail-over, and clustered Throttling and Caching support
  • WS-Security, WS-Reliable Messaging, Caching & Throttling configurable via (message/operation/service level) WS-Policies
  • Lightweight, XML and Web services centric messaging model
  • Support for industrial standards (Hessian binary web service protocol/ Financial Information eXchange protocol and optional Health Level-7 protocol)
  • Enhanced support for the VFS (File/FTP/SFTP), JMS, Mail transports with optional TCP/UDP transports and transport switching among any of the above transports
  • Support for message splitting & aggregation using the EIP and service callouts
  • Database lookup & store support with DBMediators with reusable database connection pools
  • WS-Eventing support
  • Rule based mediation of the messages using the Drools rule engine
  • Transactions support via the JMS transport and Transaction mediator for database mediators
  • Internationalized GUI management console with user management for configuration development
  • Integrated monitoring support with statistics, configurable logging and tracing
  • JMX monitoring support and JMX management capabilities like, Graceful/Forceful shutdown/restart

Bugs Fixed in This Release

This release of WSO2 ESB comes with a number of bug fixes, both in the base framework and the ESB specific components. All the issues which have been fixed in ESB 4.6.0 are recorded at following locations:

Known Issues

All the open issues pertaining to WSO2 ESB 4.6.0 are reported at following locations:

How You Can Contribute

Mailing Lists

Join our mailing list and correspond with the developers directly.
  • Developer List : dev@wso2.org | Subscribe | Mail Archive

Reporting Issues

We encourage you to report issues, documentation faults and feature requests regarding WSO2 ESB through the public ESB JIRA. You can use the Carbon JIRA to report any issues related to the Carbon base framework or associated Carbon components.

Discussion Forums

Alternatively, questions could be raised on http://stackoverflow.com.

Support

We are committed to ensuring that your enterprise middleware deployment is completely supported from evaluation to production. Our unique approach ensures that all support leverages our open development methodology and is provided by the very same engineers who build the technology.
For more details and to take advantage of this unique opportunity please visit http://wso2.com/support.
For more information about WSO2 ESB please see http://wso2.com/products/enterprise-service-bus.
-- The WSO2 ESB Team --




Sunday, January 20, 2013

Configure WSO2 ESB Proxy to work with .NET services


     When invoke .NET back-end  generally  they do not supporting chunked encoding. By default when  ESB calls back end it assumes back end supports chunked encoding.If your .Net back end service cannot access through proxy service you can try this.Sometimes you may get empty response for the request due to this issue.So what we have to do is add following 2 lines to in sequence 



 
  
   
   
   
     
       




Saturday, January 5, 2013

ESB 4.6.0 TO BE RELEASED SOON !

     Recent times  ESB performance regards as hot topic for some organizations, and some of them have published stats criticizing  most of the  other ESB's and  claiming they are the fastest, and WSO2 ESB 4.6.0 will be released with some enhanced features concerning the performance aspects, and this to give you some hint on what will come next, and will be publishing a comprehensive performance article and will invite everyone to come and have a look at what are the improvements...I will personally publish a comprehensive article based on stats but will be against ( WSO2 4.5.1 vs WSO2 4.6.0 ) .. get ready folks ...

                  HAPPY NEW YEAR FOLKS...!