[jboss-svn-commits] JBL Code SVN: r15461 - in labs/jbossesb/trunk/product/samples/quickstarts: load_generator and 9 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Sep 30 15:44:21 EDT 2007


Author: james.williams at jboss.com
Date: 2007-09-30 15:44:21 -0400 (Sun, 30 Sep 2007)
New Revision: 15461

Added:
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/build.xml
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/deployment.xml
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jbm-queue-service.xml
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jbmq-queue-service.xml
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jbossesb-properties.xml
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jndi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/juddi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/lib/
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/log4j.xml
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/readme.txt
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/JMSLoadAgent.groovy
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/jndi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/load.properties
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/payload.xml
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/load_generator/
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/load_generator/JMSLoadAction.java
Log:
http://jira.jboss.com/jira/browse/JBESB-1105

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/build.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/build.xml	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,58 @@
+<project name="Quickstart_load_generator" default="run" basedir=".">
+
+	<description> 
+		${ant.project.name}
+		${line.separator}
+	</description>
+
+	<!-- Import the base Ant build script... -->
+	<import file="../conf/base-build.xml" />
+	<property file="../conf/quickstarts.properties" />
+
+	<property environment="env" />
+
+	<path id="groovy.classpath">
+		<fileset dir="${env.GROOVY_HOME}/embeddable/" includes="*.jar" />
+		<fileset dir="${env.GROOVY_HOME}/lib/" includes="commons-*.jar" />
+		<fileset dir="${org.jboss.esb.server.home}/client" includes="jbossall-client.jar" />
+	</path>
+
+	<taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="groovy.classpath" />
+
+	<target name="compile-churn" depends="compile" description="compile groovy to bytecode">
+		<mkdir dir="load_generator_classes" />
+		<copy todir="load_generator_classes" overwrite="true">
+			<fileset dir="${basedir}/scripts/">
+				<include name="*.xml" />
+				<include name="*.properties" />
+			</fileset>
+		</copy>
+		<groovyc destdir="load_generator_classes" srcdir="${basedir}/scripts" includes="*.groovy" classpathref="groovy.classpath" />
+	</target>
+
+	<target name="load-agent" depends="compile-churn" description="Test the load agent script/settings">
+		<java classname="JMSLoadAgent">
+			<classpath refid="groovy.classpath" />
+			<classpath location="load_generator_classes" />
+		</java>
+	</target>
+
+	<target name="load-report" depends="compile-churn" description="Test the report agent script/settings">
+		<java classname="LoadReport">
+			<classpath refid="groovy.classpath" />
+			<classpath location="load_generator_classes" />
+		</java>
+	</target>
+
+	<target name="load-run" depends="compile-churn" description="Run the agent in background thread and report script in console">
+		<java classname="JMSLoadAgent" fork="true" spawn="true">
+					<classpath refid="groovy.classpath" />
+					<classpath location="load_generator_classes" />
+				</java>
+		<java classname="LoadReport">
+			<classpath refid="groovy.classpath" />
+			<classpath location="load_generator_classes" />
+		</java>		
+	</target>
+
+</project>

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/deployment.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/deployment.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/deployment.xml	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,5 @@
+<jbossesb-deployment>
+  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_load_generator_Request_gw</depends>
+  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_load_generator_Request_esb</depends>
+  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_load_generator_Request_esb2</depends>
+</jbossesb-deployment>

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jbm-queue-service.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jbm-queue-service.xml	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+	<mbean code="org.jboss.jms.server.destination.QueueService"
+		name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_load_generator_Request_gw"
+		xmbean-dd="xmdesc/Queue-xmbean.xml">
+		<depends optional-attribute-name="ServerPeer">
+			jboss.messaging:service=ServerPeer
+		</depends>
+		<depends>jboss.messaging:service=PostOffice</depends>
+	</mbean>
+	<mbean code="org.jboss.jms.server.destination.QueueService"
+		name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_load_generator_Request_esb"
+		xmbean-dd="xmdesc/Queue-xmbean.xml">
+		<depends optional-attribute-name="ServerPeer">
+			jboss.messaging:service=ServerPeer
+		</depends>
+		<depends>jboss.messaging:service=PostOffice</depends>
+	</mbean>
+	<mbean code="org.jboss.jms.server.destination.QueueService"
+		name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_load_generator_Request_esb2"
+		xmbean-dd="xmdesc/Queue-xmbean.xml">
+		<depends optional-attribute-name="ServerPeer">
+			jboss.messaging:service=ServerPeer
+		</depends>
+		<depends>jboss.messaging:service=PostOffice</depends>
+	</mbean>
+</server>

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jbmq-queue-service.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jbmq-queue-service.xml	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_load_generator_Request_gw">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+  </mbean>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_load_generator_Request_esb">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+  </mbean>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_load_generator_Request_esb2">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+  </mbean>
+</server>

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jboss-esb.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jboss-esb.xml	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,67 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb
+	xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
+	parameterReloadSecs="5">
+
+	<providers>
+		<jms-provider name="JBossMQ"
+			connection-factory="ConnectionFactory"
+			jndi-URL="jnp://127.0.0.1:1099"
+			jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+			jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
+
+			<jms-bus busid="quickstartGwChannel">
+				<jms-message-filter dest-type="QUEUE"
+					dest-name="queue/quickstart_load_generator_Request_gw" />
+			</jms-bus>
+			<jms-bus busid="quickstartEsbChannel">
+				<jms-message-filter dest-type="QUEUE"
+					dest-name="queue/quickstart_load_generator_Request_esb" />
+			</jms-bus>
+			<jms-bus busid="quickstartEsbChannel2">
+				<jms-message-filter dest-type="QUEUE"
+					dest-name="queue/quickstart_load_generator_Request_esb2" />
+			</jms-bus>
+
+		</jms-provider>
+	</providers>
+
+	<services>
+		<service category="LoadServiceCategory" name="DummyJMSLoad"
+			description="Load test dummy service. used to debug load test scripts.">
+			<listeners>
+				<jms-listener name="JMS-Gateway"
+					busidref="quickstartGwChannel" maxThreads="1" is-gateway="true" />
+				<jms-listener name="load_generator"
+					busidref="quickstartEsbChannel" maxThreads="1" />
+			</listeners>
+			<actions>
+				<action name="action1"
+					class="org.jboss.soa.esb.samples.quickstart.load_generator.JMSLoadAction"
+					process="doNothing" />
+				<action name="routeAction"  class="org.jboss.soa.esb.actions.StaticRouter">
+                    <property name="destinations">
+                        <route-to service-category="LoadServiceCategory" service-name="DummyJMSLoad2" /> 
+                    </property>
+               </action>  
+			</actions>
+		</service>
+		<service category="LoadServiceCategory" name="DummyJMSLoad2"
+			description="Load test dummy service. used to debug load test scripts.">
+			<listeners>
+				<jms-listener name="load_generator"
+					busidref="quickstartEsbChannel2" maxThreads="1" />
+			</listeners>
+			<actions>
+				<action name="action1"
+					class="org.jboss.soa.esb.samples.quickstart.load_generator.JMSLoadAction"
+					process="displayMessage" />
+				<action name="action2"
+					class="org.jboss.soa.esb.actions.SystemPrintln">
+					<property name="printfull" value="true" />
+				</action>
+			</actions>
+		</service>
+	</services>
+
+</jbossesb>

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jbossesb-properties.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jbossesb-properties.xml	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, JBoss Inc., and others contributors as indicated 
+  by the @authors tag. All rights reserved. 
+  See the copyright.txt in the distribution for a
+  full listing of individual contributors. 
+  This copyrighted material is made available to anyone wishing to use,
+  modify, copy, or redistribute it subject to the terms and conditions
+  of the GNU Lesser General Public License, v. 2.1.
+  This program is distributed in the hope that it will be useful, but WITHOUT A 
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+  PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public License,
+  v.2.1 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+  MA  02110-1301, USA.
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+  These options are described in the JBossESB manual.
+  Defaults are provided here for convenience only.
+ 
+  Please read through this file prior to using the system, and consider
+  updating the specified entries.
+-->
+<esb
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+    <properties name="core">
+		<property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+		<property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+		<property name="org.jboss.soa.esb.persistence.connection.factory" 	value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+    </properties>
+    <properties name="registry">      
+    	<property name="org.jboss.soa.esb.registry.queryManagerURI"     		
+    		value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>    		
+    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"     		
+    		value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+    	<property name="org.jboss.soa.esb.registry.implementationClass" 
+    		value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.factoryClass" 
+    		value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.user" 
+    		value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.registry.password" 
+    	  value="password"/>
+    	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+    	<property name="org.jboss.soa.esb.scout.proxy.transportClass" 
+    		value="org.apache.ws.scout.transport.RMITransport"/>
+    </properties>
+    <properties name="transports" depends="core">
+    	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+    	<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+    </properties>
+    <properties name="connection">
+    	<property name="min-pool-size" value="5"/>
+    	<property name="max-pool=size" value="10"/>
+    	<property name="blocking-timeout-millis" value="5000"/>
+    	<property name="abandoned-connection-timeout" value="10000"/>
+    	<property name="abandoned-connection-time-interval" value="30000"/>
+    </properties>
+    <properties name="dbstore">
+		<property name="org.jboss.soa.esb.persistence.db.connection.url" 	value="jdbc:hsqldb:hsql://localhost:9001/"/>
+		<property name="org.jboss.soa.esb.persistence.db.jdbc.driver" 		value="org.hsqldb.jdbcDriver"/>
+		<property name="org.jboss.soa.esb.persistence.db.user" 			value="sa"/>
+		<property name="org.jboss.soa.esb.persistence.db.pwd" 			value=""/>		
+		<property name="org.jboss.soa.esb.persistence.db.pool.initial.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.min.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.max.size"	value="5"/>
+		<!--table managed by pool to test for valid connections - created by pool automatically -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.test.table"	value="pooltest"/>
+		<!-- # of milliseconds to timeout waiting for a connection from pool -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
+                <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+    </properties>
+    <properties name="messagerouting">
+    	<property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+    </properties>
+</esb>

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jndi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jndi.properties	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/jndi.properties	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/juddi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/juddi.properties	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/juddi.properties	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any 
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct 
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+ 
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+  

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/log4j.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/log4j.xml	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <!-- ============================== -->
+   <!-- Append messages to the console -->
+   <!-- ============================== -->
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <!-- ================================= -->
+   <!-- Preserve messages in a local file -->
+   <!-- ================================= -->
+
+   <!-- A size based file rolling appender -->
+   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="File" value="./listener.log"/>
+     <param name="Append" value="false"/>
+     <param name="MaxFileSize" value="500KB"/>
+     <param name="MaxBackupIndex" value="1"/>
+
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+     </layout>	    
+   </appender>
+
+   <!-- ================ -->
+   <!-- Limit categories -->
+   <!-- ================ -->
+
+   <category name="org.jboss">
+      <priority value="WARN"/>
+   </category>
+   <category name="org.jboss.soa.esb">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.jboss.internal.soa.esb">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.apache">
+      <priority value="ERROR"/>
+   </category>
+   <category name="quickstart">
+      <priority value="DEBUG"/>
+   </category>
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+      <appender-ref ref="FILE"/>
+   </root>
+
+</log4j:configuration>

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/readme.txt	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/readme.txt	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,73 @@
+Overview:
+=========
+  The purpose of the load generator quickstart to provide a good load testing 
+  framework for ESB services. The files in this quickstart provide good TPS, Average TPS
+  and load simulation for ESB services.
+
+Running this quickstart:
+========================
+  Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+  and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run standalone mode:
+=======================
+  1. In a command terminal window in the quickstart folder type
+     'ant deploy-jms-dests'.
+  2. In a command terminal window in this folder ("Window1"), type 'ant run'.
+  3. Open another command terminal window in this folder ("Window2"), type
+     'ant runtest'.
+  4. Switch back to "Window1" to see the output from the ESB
+  5. When finished, interrupt the ESB using Ctrl-C and, in this folder
+     ("Window1"), type 'ant undeploy-jms-dests'.
+
+To Run '.esb' archive mode:
+===========================
+  1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+  2. Open another command terminal window in this folder ("Window2"), type
+     'ant runtest'.
+  3. Switch back to Application Server console to see the output from the ESB
+  4. In this folder ("Window1"), type 'ant undeploy'.
+  
+Load Test Targets
+===========================
+load-run - Runs the load agent to simulate load and the load reporter to report on load
+load-agent - Simulates load only
+load-report - Report on load only
+
+NOTE: "load-run" will run the agent in a spawned thread, then start the reporter. This is 
+a good target for running tests, but if there's a problem with JMSLoadAgent.groovy, you will
+not see it. Use the "load-agent" target to troubleshoot the agent script/properties. 
+
+Also, the build.xml script assumes that you have installed Groovy and specified a $GROOVY_HOME
+environment variable. If you don't have Groovy installed, you can get it from: 
+http://groovy.codehaus.org/Download. Installing Groovy is very similar to Ant.
+
+Key Files
+===========================
+./scripts/load.properties
+This is where you specify the properties of the load script and reporter. Things like
+the number of messages, throttling of load, services to report and more are listed here
+so you don't have to edit the groovy scripts.
+
+./scripts/JMSLoadAgent.groovy
+Simulates load by popping messages to a JMS Queue. Use load.properties to specify the JMS
+queue and the throttling of messages. This script is only good for JMS load simulation,
+but it can be used as a template for other types of simulation, like file drops.
+
+./scripts/LoadReport.groovy
+Reports load on services specified in load.properties. It will write output to the console and
+to the file system. The output is CSV based for now, but it's very easy to customize it in the
+groovy script.
+
+./scripts/payload.xml
+Payload that the load agent will use for JMS messages. If testing CBR or other payload sensitive services
+make sure that the message content is valid. You can specify any payload file in load.properties.
+
+./jboss-esb.xml
+This file has 2 services, DummyJMSLoad and DummyJMSLoad2. DummyJMSLoad processes faster than DummyJMSLoad2
+and it has a router to the DummyJMSLoad2 ESB listener queue. The use of the router is meant to demonstrate
+how one can monitor TPS of a service chain, not just a single service.
+
+
+
+

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/JMSLoadAgent.groovy
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/JMSLoadAgent.groovy	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/JMSLoadAgent.groovy	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+
+import javax.jms.JMSException
+import javax.jms.ObjectMessage
+import javax.jms.Queue
+import javax.jms.QueueConnection
+import javax.jms.QueueConnectionFactory
+import javax.jms.QueueSender
+import javax.jms.QueueSession
+import javax.naming.Context
+import javax.naming.InitialContext
+import javax.naming.NamingException
+
+/**
+ * Simple Groovy load script that will simulate load for a JMS gateway based ESB service call.
+ *
+ * @author <a href="mailto:james.williams at redhat.com">james.williams at redhat.com</a>
+ */
+ 
+def Properties props = new Properties()
+props.load(new File("load_generator_classes/load.properties").newInputStream())
+
+def msgCount = props.getProperty("msgCount").toLong()
+def batchCount = props.getProperty("batchCount").toInteger()
+def batchInterval = props.getProperty("batchInterval").toInteger()
+def loadAgentWaitTime = props.getProperty("loadAgentWaitTime").toInteger() * 1000
+def payload = "load_generator_classes/" + props.getProperty("payload")
+def queue = props.getProperty("queue")
+def batchNum = 1
+
+sleep(loadAgentWaitTime)
+
+1.upto(batchCount) { 
+    setupConnection(queue)
+	QueueSender send = session.createSender(que)    
+	ObjectMessage tm = session.createObjectMessage(new File(payload).text)    
+    println "Sending batch $batchNum of $batchCount"
+   1.upto(msgCount) { 
+   	  send.send(tm)   
+   }     
+   
+   send.close() 
+   sleep(batchInterval*1000)
+   batchNum++
+}
+
+closeConnection()
+
+def setupConnection(queue) {
+	Properties properties1 = new Properties()
+	properties1.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory")
+	properties1.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces")
+	properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099")
+	InitialContext iniCtx = new InitialContext(properties1)
+	
+	Object tmp = iniCtx.lookup("ConnectionFactory")
+	QueueConnectionFactory qcf = (QueueConnectionFactory) tmp
+	conn = qcf.createQueueConnection()
+	que = (Queue) iniCtx.lookup(queue)
+	session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE)
+	conn.start()	
+}
+
+def closeConnection() {
+	conn.stop();
+    session.close();
+    conn.close();
+}
+
+println "All Messages have been delivered"
+
+
+

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,60 @@
+import javax.management.*
+import javax.naming.Context
+import javax.naming.InitialContext
+import javax.naming.NamingException
+
+/**
+ * Simple Groovy load script that will provide TPS statistics for a ESB service call.
+ *
+ * @author <a href="mailto:james.williams at redhat.com">james.williams at redhat.com</a>
+ */
+def Properties props = new Properties()
+props.load(new File("load_generator_classes/load.properties").newInputStream())
+def File reportLog = new File(props.getProperty("logFile") + "-" + new Date().getTime());
+
+def fastestServiceQueue = props.getProperty("fastestServiceQueue") 
+def serviceList = props.getProperty("serviceList").split(',')
+def esbArchive = props.getProperty("esbArchive")
+def tpsInterval = props.getProperty("tpsInterval").toInteger()
+def msgCount = props.getProperty("msgCount").toLong() * props.getProperty("batchCount").toLong()
+boolean done = false
+def statsMap = [:]
+def seconds = tpsInterval
+
+serviceList.each {
+	service ->
+	statsMap."$service-TPS" = 0
+	statsMap."$service-TPSSum" = 0
+}
+
+InitialContext ctx = new InitialContext(); // From jndi.properties
+MBeanServerConnection server = (MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor")
+
+while(!done) {	
+    println ""
+ 	serviceList.each {
+ 		service ->
+		processedMsgsBefore = server.getAttribute(new ObjectName("jboss.esb:service-name=$service,deployment=$esbArchive,category=MessageCounter"), "overall service message count").toLong()
+ 		sleep(tpsInterval*1000)
+ 		processedMsgsAfter = server.getAttribute(new ObjectName("jboss.esb:service-name=$service,deployment=$esbArchive,category=MessageCounter"), "overall service message count").toLong()
+ 		statsMap."$service-TPS" = processedMsgsAfter - processedMsgsBefore
+ 		statsMap."$service-TPSSum" += statsMap."$service-TPS" 
+ 		statsMap."$service-TPSAvg" = statsMap."$service-TPSSum" * tpsInterval / seconds
+ 		
+ 		long tps = statsMap."$service-TPS"
+ 		long avgTPS = statsMap."$service-TPSAvg"
+ 		long tpsSum = statsMap."$service-TPSSum" 		
+ 		
+ 		long duration =  seconds / 60
+ 		println "Service: $service, TPS: $tps, AVG TPS: $avgTPS, Sample Count: $tpsSum, Duration: $duration" 
+ 		reportLog.append("Service: $service, TPS: $tps, AVG TPS: $avgTPS, Sample Count: $tpsSum, Duration: $duration \n")
+ 		seconds += tpsInterval
+ 		
+ 		queueDepthCheck = server.getAttribute(new ObjectName("$fastestServiceQueue"), "QueueDepth").toLong()
+ 		if (queueDepthCheck == 0){
+ 			done = true
+ 		} 		
+ 	} 	 	
+}  
+    
+   
\ No newline at end of file

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/jndi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/jndi.properties	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/jndi.properties	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/load.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/load.properties	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/load.properties	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,34 @@
+#comma separated list of services to report on
+serviceList = DummyJMSLoad,DummyJMSLoad2
+
+#check this JMS queue for messages. report will stop if this queue is empty
+#your fastest service's listener queue should be used here. Notice the JMX specific syntax
+fastestServiceQueue = jboss.esb.quickstart.destination:service=Queue,name=quickstart_load_generator_Request_esb
+
+#ESB archive that contains the services
+esbArchive = Quickstart_load_generator.esb
+
+#Payload File (Contents of the test message)
+payload = payload.xml
+
+#Agent will send load to this JMS queue
+queue = queue/quickstart_load_generator_Request_gw
+
+#Calculate TPS once per second is default (value in seconds)
+tpsInterval = 1
+
+#Message Count per batch for Churn Agent
+msgCount = 500
+
+#Number of message batches. Total number of messages can be calculated as (msgCount * batchCount)
+batchCount = 10
+
+#How long to wait, in seconds between message batches
+batchInterval = 1
+
+#Load Agent waits this many seconds before sending it's first message batch
+loadAgentWaitTime = 1
+
+#Report Log Location
+logFile = /tmp/load_generator.log
+

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/payload.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/payload.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/payload.xml	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,3 @@
+<payload>
+	some stuff
+</payload>
\ No newline at end of file

Added: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/load_generator/JMSLoadAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/load_generator/JMSLoadAction.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/src/org/jboss/soa/esb/samples/quickstart/load_generator/JMSLoadAction.java	2007-09-30 19:44:21 UTC (rev 15461)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author <a href="mailto:james.williams at redhat.com">james.williams at redhat.com</a>
+ * 
+ */
+package org.jboss.soa.esb.samples.quickstart.load_generator;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class JMSLoadAction extends AbstractActionLifecycle {
+
+	protected ConfigTree _config;
+
+	public JMSLoadAction(ConfigTree config) {
+		_config = config;
+	}
+
+	public Message displayMessage(Message message) throws Exception {
+
+		System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+		System.out.println("Body: "
+				+ new String(message.getBody().getByteArray()));
+		System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+		Thread.sleep(10);
+		return message;
+
+	}
+
+	public Message doNothing(Message message) throws Exception {
+
+		return message;
+
+	}
+
+}
\ No newline at end of file




More information about the jboss-svn-commits mailing list