[jboss-svn-commits] JBL Code SVN: r12601 - in labs/jbossesb/trunk/product: core/services/src/org/jboss/soa/esb/services/routing and 11 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Jun 14 19:02:59 EDT 2007
Author: kurt.stam at jboss.com
Date: 2007-06-14 19:02:58 -0400 (Thu, 14 Jun 2007)
New Revision: 12601
Added:
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/lib/
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/CheckMessageStoreAction.java
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAction.java
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendEsbMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendJMSMessage.java
Modified:
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ContentBasedRouter.java
labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/routing/MessageRouter.java
Log:
JBESB-598, adding deadletter service quickstart
Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ContentBasedRouter.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ContentBasedRouter.java 2007-06-14 22:11:44 UTC (rev 12600)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ContentBasedRouter.java 2007-06-14 23:02:58 UTC (rev 12601)
@@ -46,8 +46,7 @@
*/
public class ContentBasedRouter extends AbstractActionPipelineProcessor
{
- private static final String MESSAGE_PERSISTER_SERVICE_CATEGORY = "";
- private static final String MESSAGE_PERSISTER_SERVICE_NAME = "";
+
public static final String ROUTE_TO_TAG = "route-to";
public static final String OBJECT_PATH_TAG = "object-path";
public static final String OBJECT_PATH = "path";
@@ -96,8 +95,8 @@
+ " are not in found in the destination names in the configuration "
+ _destinations.keySet() + ". Please fix your configuration.");
- MessageRouter.deliverMessage(MESSAGE_PERSISTER_SERVICE_CATEGORY
- , MESSAGE_PERSISTER_SERVICE_NAME
+ MessageRouter.deliverMessage(MessageRouter.INTERNAL_SERVICE_CATEGORY
+ , MessageRouter.DEAD_LETTER_SERVICE_NAME
, message);
}
return message;
Modified: labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/routing/MessageRouter.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/routing/MessageRouter.java 2007-06-14 22:11:44 UTC (rev 12600)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/routing/MessageRouter.java 2007-06-14 23:02:58 UTC (rev 12601)
@@ -54,6 +54,8 @@
private static Logger logger = Logger.getLogger(MessageRouter.class);
public final static String AGGEGRATOR_TAG = "aggregatorTag";
public final static String SPLITTER_TIME_STAMP = "splitterTimeStamp";
+ public static final String INTERNAL_SERVICE_CATEGORY = "JBossESB-Internal";
+ public static final String DEAD_LETTER_SERVICE_NAME = "DeadLetterService";
/**
* Routes the message to the next destination.
Added: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/build.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/build.xml 2007-06-14 23:02:58 UTC (rev 12601)
@@ -0,0 +1,31 @@
+<project name="Quickstart_deadletter" default="run" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+ <target name="runtest" depends="compile"
+ description="sends a JMS message to queue/quickstart_deadletter_Request_gw">
+ <echo>Runs Test JMS Sender</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.deadletter.test.SendJMSMessage" failonerror="true">
+ <arg value="Hello Dead Message "/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+ <target name="sendesb" depends="compile"
+ description="Will send an esb Message">
+ <echo>Runs Test ESB Message Sender</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.deadletter.test.SendEsbMessage" failonerror="true">
+ <arg value="FirstServiceESB"/> <!-- service category -->
+ <arg value="MyFailingActionListener"/> <!-- service name -->
+ <arg value="Hello Failing Message"/> <!-- Message text -->
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+</project>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/build.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/deployment.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/deployment.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/deployment.xml 2007-06-14 23:02:58 UTC (rev 12601)
@@ -0,0 +1,5 @@
+<jbossesb-deployment>
+ <depends>jboss.esb:deployment=jbossesb.esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_deadletter_Request_esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_deadletter_Request_gw</depends>
+</jbossesb-deployment>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/deployment.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbm-queue-service.xml 2007-06-14 23:02:58 UTC (rev 12601)
@@ -0,0 +1,15 @@
+<?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_deadletter_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_deadletter_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>
+</server>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbm-queue-service.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbmq-queue-service.xml 2007-06-14 23:02:58 UTC (rev 12601)
@@ -0,0 +1,15 @@
+<?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_deadletter_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_deadletter_Request_gw">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbmq-queue-service.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jboss-esb.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jboss-esb.xml 2007-06-14 23:02:58 UTC (rev 12601)
@@ -0,0 +1,63 @@
+<?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_deadletter_Request_gw"
+ />
+ </jms-bus>
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_deadletter_Request_esb"
+ />
+ </jms-bus>
+
+ </jms-provider>
+ </providers>
+
+ <services>
+ <service
+ category="FirstServiceESB"
+ name="MyFailingActionListener"
+ description="Action is going to fail and send a message to the Dead Letter Service">
+ <listeners>
+ <jms-listener name="JMS-Gateway"
+ busidref="quickstartGwChannel"
+ maxThreads="1"
+ is-gateway="true"
+ />
+ <jms-listener name="helloWorld"
+ busidref="quickstartEsbChannel"
+ maxThreads="1"
+ />
+ </listeners>
+ <actions>
+ <!-- Print the message to the console -->
+ <action name="notificationAction" class="org.jboss.soa.esb.actions.Notifier">
+ <property name="okMethod" value="notifyOK" />
+ <property name="notification-details">
+ <NotificationList>
+ <target class="NotifyConsole" />
+ </NotificationList>
+ </property>
+ </action>
+ <!-- Send message to My Action -->
+ <action name="MyFailingAction" class="org.jboss.soa.esb.samples.quickstart.deadletter.MyFailingAction">
+ <property name="destinations">
+ <route-to service-category="JBossESB-Internal" service-name="DeadLetterService" />
+ </property>
+ </action>
+ <!-- Check that the message is really there -->
+ <action name="CheckForDeadLettersInMessageStore" class="org.jboss.soa.esb.samples.quickstart.deadletter.CheckMessageStoreAction" />
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jboss-esb.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbossesb-properties.xml 2007-06-14 23:02:58 UTC (rev 12601)
@@ -0,0 +1,84 @@
+<?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/jbossesb"/>
+ <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"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jbossesb-properties.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jndi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jndi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jndi.properties 2007-06-14 23:02:58 UTC (rev 12601)
@@ -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
+
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/jndi.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/log4j.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/log4j.xml 2007-06-14 23:02:58 UTC (rev 12601)
@@ -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>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/log4j.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/readme.txt (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/readme.txt 2007-06-14 23:02:58 UTC (rev 12601)
@@ -0,0 +1,86 @@
+Overview:
+=========
+ The purpose of the messagestore quickstart sample is to show how to send
+ a message in the DeadLetter Service. The interesting piece of configuration
+ is:
+
+ <!-- Add a copy of the message to the message store under categorization 'test' -->
+ <action name="PersistAction" class="org.jboss.soa.esb.actions.MessagePersister" >
+ <property name="classfication" value="test"/>
+ <property name="message-store-class" value="org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl"/>
+ </action>
+
+ Which causes a message to be saved in the DB messageStore under the categorization 'test'. Tooling
+ will be added to inspect the messageStore.
+
+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
+
+To Run '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant undeploy-jms-dests'.
+ 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
+
+ 'run' target description:
+ In a command prompt window, start the listeners by simply running "ant"
+ in this directory. You might review the build.xml file to see how it is setup.
+ More details on the build.xml can be found later in this document. Shutdown
+ the listener by simply using Ctrl-C in that window.
+
+ 'runtest' target description:
+ In a separate command prompt window, run "ant runtest" to shoot a JMS message
+ into the listener which will then invoke the MyJMSListenerAction and display
+ it to the console. You can modify the build.xml to change the phrase
+ "Hello World" to something else and re-run "ant runtest".
+
+Project file descriptions:
+==========================
+
+ jbossesb.xml:
+ The JMS gateway and ESB configuration file. It is listening for JMS ObjectMessages or TextMessages
+ at "queue/quickstart_messagestore_Request". Messages received at "quickstart_messagestore_Request" are
+ converted jbossesb-properties.xml. Also needed by jUDDI and needs to be at the head of the classpath.
+ The jbossesb-properties.xml is used when the service first boots up for
+ self-registration based upon the service-category and service-name found in the esb-config.xml file.
+
+ jndi.properties:
+ Needed primarily for org.jboss.soa.esb.samples.quickstart.messagestore.test.SendJMSMessage that is fired by ant runtest.
+
+ log4j.xml:
+ Needed to configure log4J used by both the quickstart and the ESB itself. A listener needs a place to log.
+
+ src\quickstart\CheckMessageStoreAction.java:
+ The action class that is identified in the esb-config.xml file and is called whenever a message is received.
+
+ src\quickstart\helloworld\test\SendJMSMessage.java:
+ Shoots in the string passed in via the command line or in this case the arg attribute in the ant runtest task.
+
+ src\quickstart\helloworld\test\SendEsbMessage.java:
+ Shoots in the string passed in via the command line or in this case the arg atribute in the ant sendesb task.
+ This demonstrates how to build an "ESB aware" client that can invoke an ESB service.
+
+ build.xml:
+ Targets and structure description:
+ * the classpath property pulls the jbossesb-properties.xml file to the
+ front of the list
+ * the echoCP task is useful for making sure what you think is in your classpath is actually in your classpath
+ Usage is: ant echoCP > myclasspath.txt
+ This generates a file called myclasspath.txt which can be reviewed in a text editor
+ * the run task calls the Launcher passing in 3 arguments the most important are the esb-config.xml and
+ esb-config-gateway.xml files
+ * the runtest task calls the org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSMessage class and passes in an argument representing
+ the string-based message to be pused into the queue the gateway is listening on. Note: SendJMSMessage
+ contains a hard-coded queue name.
+
+
Added: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/CheckMessageStoreAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/CheckMessageStoreAction.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/CheckMessageStoreAction.java 2007-06-14 23:02:58 UTC (rev 12601)
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+package org.jboss.soa.esb.samples.quickstart.deadletter;
+
+import java.net.URI;
+import java.util.Map;
+
+import org.jboss.internal.soa.esb.persistence.format.MessageStoreFactory;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.persistence.MessageStore;
+
+public class CheckMessageStoreAction extends AbstractActionLifecycle {
+
+ protected ConfigTree _config;
+
+ public CheckMessageStoreAction(ConfigTree config) {
+ _config = config;
+ }
+ /**
+ * Check if the message is in the message store. The Unique Identifyer is set on the message property
+ * with name MessageStore.MESSAGE_STORE_URI.
+ *
+ * @param originalMessage
+ * @return
+ * @throws Exception
+ */
+ public Message process(Message message) throws Exception
+ {
+ //I can call the messagestore API directory if it is deployed in the same JVM
+ String messageStoreClass = "org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl";
+ MessageStore messageStore = MessageStoreFactory.getInstance().getMessageStore(messageStoreClass);
+// Get all the messages in the DLQ
+ System.out.println("Show all messages in the messageStore with category DLQ");
+ Map<URI,Message> messageMap = messageStore.getAllMessages("DLQ");
+ for (Message dlqMmessage : messageMap.values()) {
+ System.out.println("***********");
+ System.out.println(new String(dlqMmessage.getBody().getByteArray()));
+ }
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+ return message;
+
+ }
+
+}
\ No newline at end of file
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/CheckMessageStoreAction.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAction.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAction.java 2007-06-14 23:02:58 UTC (rev 12601)
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+package org.jboss.soa.esb.samples.quickstart.deadletter;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.routing.MessageRouter;
+
+public class MyFailingAction extends AbstractActionLifecycle {
+
+ protected ConfigTree _config;
+
+ public MyFailingAction(ConfigTree config) {
+ _config = config;
+ }
+ /**
+ * Check if the message is in the message store. The Unique Identifyer is set on the message property
+ * with name MessageStore.MESSAGE_STORE_URI.
+ *
+ * @param originalMessage
+ * @return
+ * @throws Exception
+ */
+ public Message process(Message message) throws Exception
+ {
+ //Suppose I'm supposed to deliver my message in this action
+ //and the service is not accessable. I can decide to send my
+ //message to the DeadLetter Service.
+ //
+ //The DeadLetter Service is custom configuble. It is defined in
+ //the jbossesb.esb an by default it stores the message in the
+ //MessageStore under the DLQ categorization.
+
+ MessageRouter.deliverMessage(MessageRouter.INTERNAL_SERVICE_CATEGORY
+ , MessageRouter.DEAD_LETTER_SERVICE_NAME
+ , message);
+
+ return message;
+
+ }
+
+}
\ No newline at end of file
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAction.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendEsbMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendEsbMessage.java 2007-06-14 23:02:58 UTC (rev 12601)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.samples.quickstart.deadletter.test;
+
+import java.net.URI;
+import java.util.Date;
+import java.util.UUID;
+
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+/**
+ * Standalone class with to send ESB messages to a 'known' [category,name].
+ * <p/> arg0 - service category
+ * <br/>arg1 - service name
+ * <br/>arg2 - Text of message to send
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ *
+ */
+public class SendEsbMessage
+{
+ public static void main(String args[]) throws Exception
+ {
+ if (args.length < 3)
+ {
+ System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
+ }
+ //Setting the ConnectionFactory such that it will use scout
+ System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
+ // Create a message, assign it a UID, and fill in call information
+ Message esbMessage = MessageFactory.getInstance().getMessage();
+ Call call = new Call();
+ call.setMessageID(new URI(UUID.randomUUID().toString()));
+ esbMessage.getHeader().setCall(call);
+
+ // set body contents with args[2], and send
+ esbMessage.getBody().setByteArray((args[2] + " - " + new Date()).getBytes());
+
+ ListenerUtil.tryToDeliver(esbMessage, args[0], args[1]);
+
+ }
+
+}
\ No newline at end of file
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendEsbMessage.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendJMSMessage.java 2007-06-14 23:02:58 UTC (rev 12601)
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+package org.jboss.soa.esb.samples.quickstart.deadletter.test;
+
+import java.util.Date;
+
+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.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.soa.esb.samples.quickstart.deadletter.test.SendJMSMessage;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ InitialContext iniCtx = new InitialContext();
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_deadletter_Request_gw");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public void sendAMessage(String msg) throws JMSException {
+
+ msg += " - " + new Date();
+ QueueSender send = session.createSender(que);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ send.send(tm);
+ send.close();
+ }
+
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(args[0]);
+ sm.stop();
+
+ }
+
+}
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendJMSMessage.java
___________________________________________________________________
Name: svn:eol-style
+ native
More information about the jboss-svn-commits
mailing list