esbperformance / talend / README.TXT

Talend ESB SE 5.1.1

Build the OSGi artifacts which contains the proxy services by using maven

    $ cd ~/resources/esbperformance/talend/
	$ mvn install

Edit {TALEND_HOME}/container/bin/setenv and add the following lines at the top
    export JAVA_MIN_MEM=2048M
    export JAVA_MAX_MEM=2048M

Copy the configuration files from configs/etc into {TALEND_HOME}/container/etc
    This configures the thread pools and http connections.

Copy the extra endorsed libs from configs/lib/endorsed into 
    to work around some bugs found in the JDK libraries. (future versions of TESB
    will have this by default)

Start the Talend ESB

	$ cd {TALEND_HOME}/container
	$ ./bin/trun

You will get the karaf console


PATCH Install:
Some testing has revealed some major issues in various parts of TESB.  These steps should help:
   1) Woodstox - 4.1.2 has a severe performance regression, particulary when used with the many
      threads of small XML (2560/512b for example).  See:
      Downgrading to 4.1.1 helps:
        karaf@trun> uninstall woodstox-core-asl
	karaf@trun> install -s mvn:org.codehaus.woodstox/woodstox-core-asl/4.1.1
   2) CXF has an issue in the many many thread case where requests might be silently dropped.
        karaf@trun> uninstall cxf-api
	karaf@trun> install -s mvn:org.apache.cxf/cxf-api/2.6.2-SNAPSHOT
   3) CXF also has an issue where HTTP conduit settings may not get picked up from OSGi.  It also
      floods the error log with warnings if the workqueue size is exceeded.
        karaf@trun> uninstall cxf-rt-transports-http
	karaf@trun> install -s mvn:org.apache.cxf/cxf-rt-transports-http/2.6.2-SNAPSHOT
	karaf@trun> install -s mvn:org.apache.cxf/cxf-rt-transports-http-jetty/2.6.2-SNAPSHOT
   4) The DOM implementation in the JDK does a System.getProperty in the Document constructor. For
      many small XML's, this severely rate limits it.  The endorsing of xercesImpl mentioned above
      handles this problem.  
   5) There is a strange interaction bug between camel-core(xslt) and camel-cxf that is causing it
      to flip to DOM mode instead of streaming the results of the xlst.  This causes a streaming 
      performance issue, but also synchronized block issues in the DocumentFactories that camel
      is using.  To fix this:
        karaf@trun> uninstall camel
        karaf@trun> install -s mvn:org.apache.camel/camel-core/2.9.3-SNAPSHOT
        karaf@trun> install -s mvn:org.apache.camel/camel-blueprint/2.9.3-SNAPSHOT
        karaf@trun> install -s mvn:org.apache.camel/camel-spring/2.9.3-SNAPSHOT
        karaf@trun> install -s mvn:org.apache.camel/camel-cxf-transport/2.9.3-SNAPSHOT
        karaf@trun> install -s mvn:org.apache.camel/camel-cxf/2.9.3-SNAPSHOT

   After the above, you should shutdown karaf:
        karaf@trun> shutdown
   so you can restart to make sure all the patches are picked up. All the above will be part of the
   next TESB service pack due in a few weeks.

Type following to install and start each proxy services into the tesb

	karaf@trun> install -s mvn:com.talend.tesb.perf/<scenario>/<version>

you will see the bundle id of the scenario from the previous command output as follows;

	Bundle ID: [ID]

Use the display or list commands to see whether the application is successfully launched

	karaf@trun> display
	karaf@trun> list | grep "Talend ESB"

Install the following features to enable the Camel XQuery processing (for the Content Based Routing tests)
        karaf@trun> install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon/
        karaf@trun> install -s mvn:org.apache.camel/camel-saxon/2.9.2

Install the following applications this way, starting each bundle as described above
 	karaf@trun> install -s mvn:com.talend.tesb.perf/proxy/1.0
	karaf@trun> install -s mvn:com.talend.tesb.perf/cbr/1.0
	karaf@trun> install -s mvn:com.talend.tesb.perf/hbr-soap/1.0
	karaf@trun> install -s mvn:com.talend.tesb.perf/hbr-transport/1.0
	karaf@trun> install -s mvn:com.talend.tesb.perf/xslt-transform/1.0
	karaf@trun> install -s mvn:com.talend.tesb.perf/secure-proxy/1.0

    karaf@trun> install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon/
    Bundle ID: 166
    karaf@trun> install -s mvn:org.apache.camel/camel-saxon/2.9.2
    Bundle ID: 167
    karaf@trun> install -s mvn:com.talend.tesb.perf/proxy/1.0
    Bundle ID: 168
    karaf@trun> install -s mvn:com.talend.tesb.perf/cbr/1.0
    Bundle ID: 169
    karaf@trun> install -s mvn:com.talend.tesb.perf/hbr-soap/1.0
    Bundle ID: 170
    karaf@trun> install -s mvn:com.talend.tesb.perf/hbr-transport/1.0
    Bundle ID: 171
    karaf@trun> install -s mvn:com.talend.tesb.perf/xslt-transform/1.0
    Bundle ID: 172
    karaf@trun> install -s mvn:com.talend.tesb.perf/secure-proxy/1.0
    Bundle ID: 173
karaf@trun> list | grep "Talend ESB"
[ 168] [Active     ] [            ] [Started] [   80] Talend ESB :: Direct Proxy (1.0.0)
[ 169] [Active     ] [            ] [Started] [   80] Talend ESB :: Content Based Router (1.0.0)
[ 170] [Active     ] [            ] [Started] [   80] Talend ESB :: Header Based Router :: SOAP (1.0.0)
[ 171] [Active     ] [            ] [Started] [   80] Talend ESB :: Header Based Router :: Transport (1.0.0)
[ 172] [Active     ] [            ] [Started] [   80] Talend ESB :: XSLT Transformer (1.0.0)
[ 173] [Active     ] [            ] [Started] [   80] Talend ESB :: Secure Proxy (1.0.0)

If you start the AMI EC2 image again and then the Talend ESB, sometimes the performance test may not run, as the order of starting of the bundles has an effect. If this happens, stop the bundles, and restart them in the correct order.

    karaf@trun> stop 173
    karaf@trun> stop 172
    karaf@trun> stop 171
    karaf@trun> stop 170
    karaf@trun> stop 169
    karaf@trun> stop 168
    karaf@trun> start 168
    karaf@trun> start 169
    karaf@trun> start 170
    karaf@trun> start 171
    karaf@trun> start 172
    karaf@trun> start 173

Before executing the performance test, re-generate the WS-Security related requests as Talend ESB is particular about the timestamps used
    $ cd client-scripts
    $ ./

Service URLs

proxy - a direct proxy service
    url             : http://localhost:9080/service/DirectProxy
    wsdl-url        : http://localhost:9080/service/DirectProxy?wsdl
    karaf-command   : install mvn:com.talend.tesb.perf/proxy/1.0

cbr - a content based router, routing the message by looking at the SOAP body content
    url             : http://localhost:9080/service/CBRProxy
    wsdl-url        : http://localhost:9080/service/CBRProxy?wsdl
    karaf-command   : install mvn:com.talend.tesb.perf/cbr/1.0

hbr-soap - a header based router, routing the messages by looking at the [{http://someuri}routing] SOAP header
    url             : http://localhost:9080/service/CBRSOAPHeaderProxy
    wsdl-url        : http://localhost:9080/service/CBRSOAPHeaderProxy?wsdl
    karaf-command   : install mvn:com.talend.tesb.perf/hbr-soap/1.0

hbr-transport - a header based router, routing the messages by looking at the [routing] HTTP transport header
    url             : http://localhost:9080/service/CBRTransportHeaderProxy
    wsdl-url        : http://localhost:9080/service/CBRTransportHeaderProxy?wsdl
    karaf-command   : install mvn:com.talend.tesb.perf/hbr-transport/1.0

xslt-transform - a transforming proxy which transforms the message to its element character inverse on the in path and
does the back transformation on the out path using XSLT
    url             : http://localhost:9080/service/XSLTProxy
    wsdl-url        : http://localhost:9080/service/XSLTProxy?wsdl
    karaf-command   : install mvn:com.talend.tesb.perf/xslt-transform/1.0

secure-proxy - a security gateway pattern proxy where the proxy created at the talend ESB enforces security with Timestamp,
Encrypted and Signed messages into and back out to the client, while the server to ESB communication is kept in plane SOAP
    url             : http://localhost:9080/service/SecureProxy
    wsdl-url        : http://localhost:9080/service/SecureProxy?wsdl
    karaf-command   : install mvn:com.talend.tesb.perf/secure-proxy/1.0


Only if you get any issues in deploying the child configurations according to the specific README.txt files, do the following and try again

	karaf@trun> features:install camel-http

Exceptions seen on the logs during the load test execution. The Talend team confirmed this was a harmless exception thrown by the Jetty server, which does not affect performance or correct operation, and which would be fixed in a subsequent release

2012-08-04 02:57:51.485:WARN:oeji.nio:
java.lang.IllegalArgumentException: timeout value is negative
	at java.lang.Object.wait(Native Method)
	at org.eclipse.jetty.http.AbstractGenerator.blockForOutput(
	at org.eclipse.jetty.server.HttpOutput.write(
	at org.eclipse.jetty.server.HttpOutput.write(
	at org.apache.camel.util.IOHelper.copy(
	at org.apache.camel.util.IOHelper.copy(
	at org.apache.camel.component.cxf.interceptors.RawMessageContentRedirectInterceptor.handleMessage(
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
	at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
	at org.apache.cxf.phase.PhaseInterceptorChain.resume(
	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
	at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(
	at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(
	at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
	at org.eclipse.jetty.server.Server.handleAsync(
	at org.eclipse.jetty.server.HttpConnection.handleRequest(
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
	at org.eclipse.jetty.util.thread.QueuedThreadPool$