[jboss-cvs] JBoss Messaging SVN: r2285 - in trunk: docs/clustering/en/modules and 11 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Feb 13 04:24:04 EST 2007
Author: ovidiu.feodorov at jboss.com
Date: 2007-02-13 04:24:04 -0500 (Tue, 13 Feb 2007)
New Revision: 2285
Added:
trunk/docs/examples/distributed-queue/
trunk/docs/examples/distributed-queue/README.html
trunk/docs/examples/distributed-queue/build.xml
trunk/docs/examples/distributed-queue/do-not-distribute.properties
trunk/docs/examples/distributed-queue/etc/
trunk/docs/examples/distributed-queue/etc/jndi.properties
trunk/docs/examples/distributed-queue/etc/log4j.xml
trunk/docs/examples/distributed-queue/src/
trunk/docs/examples/distributed-queue/src/org/
trunk/docs/examples/distributed-queue/src/org/jboss/
trunk/docs/examples/distributed-queue/src/org/jboss/example/
trunk/docs/examples/distributed-queue/src/org/jboss/example/jms/
trunk/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/
trunk/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/DistributedQueueExample.java
trunk/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/ExampleListener.java
Removed:
trunk/lib/jboss-remoting.jar
Modified:
trunk/build-thirdparty.xml
trunk/docs/clustering/en/modules/installation.xml
trunk/messaging.iml
trunk/messaging.ipr
trunk/util/do-not-distribute.properties
trunk/util/release-admin.xml
Log:
Partial work on the distributed queue example (http://jira.jboss.org/jira/browse/JBMESSAGING-690)
Encountered http://jira.jboss.org/jira/browse/JBMESSAGING-831
Modified: trunk/build-thirdparty.xml
===================================================================
--- trunk/build-thirdparty.xml 2007-02-13 06:47:23 UTC (rev 2284)
+++ trunk/build-thirdparty.xml 2007-02-13 09:24:04 UTC (rev 2285)
@@ -92,7 +92,7 @@
<componentref name="jboss/common-logging-spi" version="2.0.2.GA"/>
<componentref name="jboss/aop" version="1.5.0.GA"/>
<componentref name="jboss/serialization" version="1.0.3.GA"/>
- <componentref name="jboss/remoting" version="2.2.0.Alpha6"/>
+ <componentref name="jboss/remoting" version="2.2.0.Alpha7"/>
<componentref name="jboss/jbossts" version="4.2.2.GA"/>
<!-- Need this otherwise project doesn't build in Eclipse -->
Modified: trunk/docs/clustering/en/modules/installation.xml
===================================================================
--- trunk/docs/clustering/en/modules/installation.xml 2007-02-13 06:47:23 UTC (rev 2284)
+++ trunk/docs/clustering/en/modules/installation.xml 2007-02-13 09:24:04 UTC (rev 2285)
@@ -15,15 +15,40 @@
ant -f release-admin.xml [-Did=node-id] [-Dports=port-config-label] cluster-node
</programlisting>
-
<para>
where:
<itemizedlist>
<listitem>
- <filename>node-id</filename> is the unique node ID, an integer that must be unique per cluster.
+ <filename>node-id</filename> is the unique node ID, an integer that must be unique per
+ cluster. If not specified, it defaults to 0.
</listitem>
<listitem>
<filename>port-config-label</filename> is a binding manager server configuration label.
+
+ The short story behind this parameter is the following: multiple application servers
+ running on the same physical machine need to use different service port ranges to avoid
+ port conflicts. You can configure the whole port range used by a server instance
+ by enabling a special service, the binding management service, and specifiying a
+ "server" configuration in the binding manager's configuration file, which will determine
+ specific port values to use when starting that instance.
+
+ The Messaging installation script can enable the service binding manager and performs
+ all configuration changes automatically. You only need to specify the "server"
+ configuration you want to use, as 'port-config-label'.
+
+ If you plan to run your clustering nodes on different physical machines, this parameter
+ is irrelevant, and you should not use it. However, if you install two (or more) nodes of
+ your cluster on the same physical machine, you need to give the value corresponding to
+ a specific "server" configurations in the binding manager configuration file. JBoss AS
+ ships "out-of-the-box" with several pre-configured port ranges: 'ports-default',
+ 'ports-01', 'ports-02', 'ports-03'. Use one of these.
+
+ If -Dports is not specified, the clustered instance so created will fall over to the
+ default port range for a JBoss instace.
+
+ More details about the binding management service can be found in the Application Server
+ documentation, at the following address
+ <ulink url="http://docs.jboss.com/jbossas/guides/j2eeguide/r2/en/html_single/#ch10.bindingmanager">http://docs.jboss.com/jbossas/guides/j2eeguide/r2/en/html_single/#ch10.bindingmanager</ulink>
</listitem>
</itemizedlist>
</para>
@@ -34,19 +59,23 @@
</para>
<programlisting>
- ant -f release-admin.xml -Did=0 cluster-node
+ ant -f release-admin.xml cluster-node
ant -f release-admin.xml -Did=1 -Dports=ports-01 cluster-node
ant -f release-admin.xml -Did=2 -Dports=ports-02 cluster-node
ant -f release-admin.xml -Did=3 -Dports=ports-03 cluster-node
</programlisting>
-
<para>
The sequence will create four cluster node configurations ("messaging-node0",
"messaging-node1", "messaging-node2" and "messaging-node3").
</para>
<para>
+ The first command will create a cluster node with ID equals to '0' and using the
+ default JBoss AS port assignments.
+ </para>
+
+ <para>
<warning>
The configuration that has just been created uses a generic mysql service descriptor.
@@ -83,44 +112,120 @@
<para>
- A successful node startup produces a log similar to:
+ A successful two node cluster startup produces a log similar to:
</para>
+ <para>
+ Node 0:
+ </para>
+
+
<programlisting>
- 04:48:49,663 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:name=DefaultDS,service=DataSourceBinding' to JNDI name 'java:DefaultDS'
- 04:48:50,257 INFO [ServerPeer] JBoss Messaging 1.2.0.Beta2 server [0] started
- 04:48:50,569 INFO [STDOUT]
+ ...
+
+ 00:24:04,796 WARN [JDBCPersistenceManager]
+
+ JBoss Messaging Warning: DataSource connection transaction isolation should be READ_COMMITTED, but it is currently REPEATABLE_READ.
+ Using an isolation level less strict than READ_COMMITTED may lead to data consistency problems.
+ Using an isolation level more strict than READ_COMMITTED may lead to deadlock.
+
+ 00:24:05,718 INFO [ServerPeer] JBoss Messaging 1.2.0.CR1 server [0] started
+ 00:24:06,328 INFO [STDOUT]
-------------------------------------------------------
- GMS: address is 127.0.0.1:1473
+ GMS: address is 127.0.0.1:2452
-------------------------------------------------------
- 04:48:52,616 INFO [STDOUT]
+ 00:24:08,406 INFO [DefaultClusteredPostOffice] ClusteredPostOffice[0:Clustered JMS:127.0.0.1:2452] got new view [127.0.0.1:2452|0] [127.0.0.1:2452]
+ 00:24:08,468 INFO [STDOUT]
-------------------------------------------------------
- GMS: address is 127.0.0.1:1475
+ GMS: address is 127.0.0.1:2455
-------------------------------------------------------
- 04:48:54,694 INFO [QueueService] Queue[/queue/DLQ] started, fullSize=75000, pageSize=2000, downCacheSize=2000
- 04:48:54,694 INFO [QueueService] Queue[/queue/testQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
- 04:48:54,694 INFO [QueueService] Queue[/queue/A] started, fullSize=75000, pageSize=2000, downCacheSize=2000
- 04:48:54,710 INFO [QueueService] Queue[/queue/B] started, fullSize=75000, pageSize=2000, downCacheSize=2000
- 04:48:54,710 INFO [QueueService] Queue[/queue/C] started, fullSize=75000, pageSize=2000, downCacheSize=2000
- 04:48:54,710 INFO [QueueService] Queue[/queue/D] started, fullSize=75000, pageSize=2000, downCacheSize=2000
- 04:48:54,710 INFO [QueueService] Queue[/queue/ex] started, fullSize=75000, pageSize=2000, downCacheSize=2000
- 04:48:54,726 INFO [QueueService] Queue[/queue/testDistributedQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
- 04:48:54,772 INFO [STDOUT]
+ 00:24:10,906 INFO [ConnectionFactory] Connector socket://10.11.14.105:4457 has leasing enabled, lease period 10000 milliseconds
+ 00:24:10,921 INFO [ConnectionFactory] [/ConnectionFactory, /XAConnectionFactory, java:/ConnectionFactory, java:/XAConnectionFactory] started
+ 00:24:10,953 INFO [QueueService] Queue[/queue/DLQ] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,953 INFO [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,953 INFO [TopicService] Topic[/topic/testTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,953 INFO [TopicService] Topic[/topic/securedTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,968 INFO [TopicService] Topic[/topic/testDurableTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,968 INFO [QueueService] Queue[/queue/testQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,968 INFO [QueueService] Queue[/queue/A] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,968 INFO [QueueService] Queue[/queue/B] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,968 INFO [QueueService] Queue[/queue/C] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,968 INFO [QueueService] Queue[/queue/D] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,968 INFO [QueueService] Queue[/queue/ex] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,984 INFO [QueueService] Queue[/queue/PrivateDLQ] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,984 INFO [QueueService] Queue[/queue/PrivateExpiryQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,984 INFO [QueueService] Queue[/queue/QueueWithOwnDLQAndExpiryQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,984 INFO [TopicService] Topic[/topic/TopicWithOwnDLQAndExpiryQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,984 INFO [QueueService] Queue[/queue/QueueWithOwnRedeliveryDelay] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:10,984 INFO [TopicService] Topic[/topic/TopicWithOwnRedeliveryDelay] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:11,000 INFO [QueueService] Queue[/queue/testDistributedQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:11,000 INFO [TopicService] Topic[/topic/testDistributedTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:24:11,093 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:name=JmsXA,service=ConnectionFactoryBinding' to JNDI name 'java:JmsXA'
+ 00:24:11,375 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
+ 00:24:12,171 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
+ 00:24:12,421 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
+ 00:24:12,453 INFO [JkMain] Jk running ID=0 time=0/47 config=null
+ 00:24:12,515 INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200611221632)] Started in 30s:375ms
+
+ 00:27:21,343 INFO [DefaultClusteredPostOffice] ClusteredPostOffice[0:Clustered JMS:127.0.0.1:2452] got new view [127.0.0.1:2452|1] [127.0.0.1:2452, 127.0.0.1:2474]
+
+</programlisting>
+
+ <para>
+ Node 1:
+ </para>
+
+ <programlisting>
+
+ ...
+
+ 00:33:54,468 WARN [JDBCPersistenceManager]
+
+ JBoss Messaging Warning: DataSource connection transaction isolation should be READ_COMMITTED, but it is currently REPEATABLE_READ.
+ Using an isolation level less strict than READ_COMMITTED may lead to data consistency problems.
+ Using an isolation level more strict than READ_COMMITTED may lead to deadlock.
+
+ 00:33:55,062 INFO [ServerPeer] JBoss Messaging 1.2.0.CR1 server [1] started
+ 00:33:55,609 INFO [STDOUT]
-------------------------------------------------------
- GMS: address is 127.0.0.1:1485
+ GMS: address is 127.0.0.1:2514
-------------------------------------------------------
- 04:48:56,788 INFO [STDOUT]
+ 00:33:57,734 INFO [DefaultClusteredPostOffice] ClusteredPostOffice[1:Clustered JMS:127.0.0.1:2514] got new view [127.0.0.1:2452|3] [127.0.0.1:2452, 127.0.0.1:2514]
+ 00:33:57,765 INFO [STDOUT]
-------------------------------------------------------
- GMS: address is 127.0.0.1:1487
+ GMS: address is 127.0.0.1:2519
-------------------------------------------------------
- 04:48:58,804 INFO [TopicService] Topic[/topic/testTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
- 04:48:58,804 INFO [TopicService] Topic[/topic/securedTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
- 04:48:58,804 INFO [TopicService] Topic[/topic/testDurableTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
- 04:48:58,804 INFO [TopicService] Topic[/topic/testDistributedTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
- 04:48:59,335 INFO [ConnectionFactory] Connector socket://192.168.1.101:4457 has leasing enabled, lease period 20000 milliseconds
- 04:48:59,335 INFO [ConnectionFactory] [/ConnectionFactory, /XAConnectionFactory, java:/ConnectionFactory, java:/XAConnectionFactory] deployed
- 04:48:59,366 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:name=JmsXA,service=ConnectionFactoryBinding' to JNDI name 'java:JmsXA'
-</programlisting>
+ 00:34:00,203 INFO [ConnectionFactory] Connector socket://10.11.14.105:4557 has leasing enabled, lease period 20000 milliseconds
+ 00:34:00,203 INFO [ConnectionFactory] [/ConnectionFactory, /XAConnectionFactory, java:/ConnectionFactory, java:/XAConnectionFactory] started
+ 00:34:00,234 INFO [QueueService] Queue[/queue/DLQ] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,234 INFO [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,234 INFO [TopicService] Topic[/topic/testTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,250 INFO [TopicService] Topic[/topic/securedTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,250 INFO [TopicService] Topic[/topic/testDurableTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,250 INFO [QueueService] Queue[/queue/testQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,250 INFO [QueueService] Queue[/queue/A] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,250 INFO [QueueService] Queue[/queue/B] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,250 INFO [QueueService] Queue[/queue/C] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,250 INFO [QueueService] Queue[/queue/D] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,250 INFO [QueueService] Queue[/queue/ex] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,265 INFO [QueueService] Queue[/queue/PrivateDLQ] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,265 INFO [QueueService] Queue[/queue/PrivateExpiryQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,265 INFO [QueueService] Queue[/queue/QueueWithOwnDLQAndExpiryQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,265 INFO [TopicService] Topic[/topic/TopicWithOwnDLQAndExpiryQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,265 INFO [QueueService] Queue[/queue/QueueWithOwnRedeliveryDelay] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,265 INFO [TopicService] Topic[/topic/TopicWithOwnRedeliveryDelay] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,296 INFO [QueueService] Queue[/queue/testDistributedQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,296 INFO [TopicService] Topic[/topic/testDistributedTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
+ 00:34:00,343 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:name=JmsXA,service=ConnectionFactoryBinding' to JNDI name 'java:JmsXA'
+ 00:34:00,453 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
+ 00:34:00,796 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8180
+ 00:34:01,078 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8109
+ 00:34:01,125 INFO [JkMain] Jk running ID=0 time=0/125 config=null
+ 00:34:01,125 INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200611221632)] Started in 22s:547ms
+
+ </programlisting>
+
+
</chapter>
Added: trunk/docs/examples/distributed-queue/README.html
===================================================================
--- trunk/docs/examples/distributed-queue/README.html (rev 0)
+++ trunk/docs/examples/distributed-queue/README.html 2007-02-13 09:24:04 UTC (rev 2285)
@@ -0,0 +1,143 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+ <title>JBoss Messaging Example - JMS Topic</title>
+</head>
+<body>
+<br>
+<h1>JBoss Messaging Distributed Topic Example</h1>
+$Revision: 1017 $
+<h2>Overview</h2>
+<br>
+This example demonstrates how to write JMS code that connects to a
+JBoss Messaging cluster and sends messages to a distributed topic. The
+client code creates two distinct JMS connections to two different
+cluster nodes. Each connection is then used to create a subscriber for
+the distributed topic. The example is considered
+successful
+if both subscribers receive a message sent to the topic.<br>
+<br>
+This example relies on having access to a running JBoss Messaging
+cluster with at least two nodes. The JBoss Messaging cluster must be
+installed and started according to
+the
+"Installation" paragraph from the clustering documentation, bundled
+with the release (<a href="../../docs/clustering/html/index.html">HTML</a>,
+<a href="../../docs/clustering/html_single/index.html">HTML-single</a>
+and <a href="../../docs/clustering/pdf/ClusteringGuide.pdf">PDF</a>).
+The
+clustering documentation is also available on-line at <a
+ href="http://labs.jboss.com/portal/jbossmessaging/docs/index.html">http://labs.jboss.com/portal/jbossmessaging/docs/index.html</a>.
+<br>
+<br>
+This example also relies on having access to the <span
+ style="font-family: monospace;">jboss-messaging-client.jar</span>
+archive included with the release bundle. If you run this example
+from
+an unzipped installation bundle, the example run script is correctly
+configured to find the client jar. Otherwise, you must modify example's
+<span style="font-family: monospace;">build.xml</span> accordingly.<br>
+<span style="font-style: italic;"></span><br>
+<h2>Running the example</h2>
+<span style="font-family: monospace;"></span><span
+ style="font-family: monospace;"></span><br>
+1. Make sure that a JBoss Messaging cluster with at least two nodes is
+up and running.<br>
+<br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">cd
+...\examples\distributed-topic</span><br>
+</div>
+<br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">ant</span>
+<br>
+<br>
+<br>
+</div>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">
+ <div style="margin-left: 40px;"><br>
+ </div>
+$ ant<br>
+Buildfile: build.xml<br>
+ <br>
+identify:<br>
+ [echo]
+###########################################################################<br>
+ [echo]
+#
+Running the DISTRIBUTED TOPIC
+example
+#<br>
+ [echo]
+###########################################################################<br>
+ [echo] The
+topic: testDistributedTopic<br>
+ [echo] The client jar:
+../../../output/lib/jboss-messaging-client.jar<br>
+ <br>
+sanity-check:<br>
+ <br>
+init:<br>
+ [mkdir] Created dir:
+C:\work\src\svn\messaging\docs\examples\distributed-topic\output<br>
+ [mkdir] Created dir:
+C:\work\src\svn\messaging\docs\examples\common\output<br>
+ <br>
+compile:<br>
+ [javac] Compiling 2 source files to
+C:\work\src\svn\messaging\docs\examples\common\output<br>
+ [javac] Compiling 2 source files to
+C:\work\src\svn\messaging\docs\examples\distributed-topic\output<br>
+ <br>
+run:<br>
+ [java] Distributed topic
+/topic/testDistributedTopic exists<br>
+ [java] The message was successfully published
+on the distributed topic<br>
+ [java] MessageListener 1 received message:
+Hello!<br>
+ [java] MessageListener 2 received message:
+Hello!<br>
+ [java] The example connected to JBoss
+Messaging version 1.2.0.Beta1 (1.2)<br>
+ <br>
+ [java] #####################<br>
+ [java] ###
+SUCCESS! ###<br>
+ [java] #####################<br>
+ <br>
+BUILD SUCCESSFUL<br>
+Total time: 4 seconds<br>
+ <br>
+ <br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<br>
+<br>
+<br>
+<hr style="width: 100%; height: 2px;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>
Added: trunk/docs/examples/distributed-queue/build.xml
===================================================================
--- trunk/docs/examples/distributed-queue/build.xml (rev 0)
+++ trunk/docs/examples/distributed-queue/build.xml 2007-02-13 09:24:04 UTC (rev 2285)
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+ To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+ $Id: build.xml 974 2006-05-22 21:35:38 -0600 (Mon, 22 May 2006) ovidiu $
+
+ -->
+
+<project name="DistributedQueueExample" default="run">
+
+ <property environment="ENV"/>
+
+ <!--
+ If you don't find this file in the current directory, it's ok, it's intended to provide
+ defaults for in-workarea testing and it's not meant for distribution with the example bundle.
+ -->
+ <property file="do-not-distribute.properties"/>
+
+ <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+ <property name="messaging.client.jar.path" value="../.."/>
+ <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+ <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+ <property name="example.queue.name" value="testDistributedQueue"/>
+
+ <path id="common.compilation.classpath">
+ <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+ <fileset file="${jboss.home}/client/jboss-j2se.jar"/>
+ <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+ </path>
+
+ <path id="example.compilation.classpath">
+ <path refid="common.compilation.classpath"/>
+ <pathelement path="../common/output"/>
+ </path>
+
+ <path id="execution.classpath">
+ <pathelement path="./etc"/>
+ <pathelement path="../common/output"/>
+ <pathelement path="./output"/>
+ <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+ </path>
+
+ <target name="identify">
+ <echo message="###########################################################################"/>
+ <echo message="# Running the DISTRIBUTED QUEUE example #"/>
+ <echo message="###########################################################################"/>
+ <echo message="The queue: ${example.queue.name}"/>
+ <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+ </target>
+
+ <target name="sanity-check" depends="identify">
+ <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+ <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+ unless="client.jar.present"/>
+ </target>
+
+ <target name="init" depends="sanity-check">
+ <mkdir dir="./output"/>
+ <mkdir dir="../common/output"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac destdir="../common/output" debug="on" debuglevel="lines,vars,source">
+ <src path="../common/src"/>
+ <classpath refid="common.compilation.classpath"/>
+ </javac>
+ <javac destdir="./output" debug="on" debuglevel="lines,vars,source">
+ <src path="./src"/>
+ <classpath refid="example.compilation.classpath"/>
+ </javac>
+ </target>
+
+ <target name="run" depends="compile">
+ <!--
+ DistributedQueueExample expects to find the name of the queue to connect to as value of
+ the 'example.queue.name' property, which *may* be defined by calling ant when this
+ example is used in a smoke test.
+ -->
+ <java classname="org.jboss.example.jms.distributedqueue.DistributedQueueExample"
+ classpathref="execution.classpath" fork="yes" failonerror="true">
+ <sysproperty key="example.queue.name" value="${example.queue.name}"/>
+ <!--
+ <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+ -->
+ </java>
+ </target>
+
+ <target name="clean">
+ <delete dir="./output" quiet="true"/>
+ <delete dir="../common/output" quiet="true"/>
+ </target>
+
+</project>
+
Property changes on: trunk/docs/examples/distributed-queue/build.xml
___________________________________________________________________
Name: svn:keywords
+ "Id LastChangedDate Author Revision"
Added: trunk/docs/examples/distributed-queue/do-not-distribute.properties
===================================================================
--- trunk/docs/examples/distributed-queue/do-not-distribute.properties (rev 0)
+++ trunk/docs/examples/distributed-queue/do-not-distribute.properties 2007-02-13 09:24:04 UTC (rev 2285)
@@ -0,0 +1,7 @@
+#
+# This file provides values for in-workarea example testing.
+# DO NOT DISTRIBUTE!
+#
+messaging.client.jar.path=../../../output/lib
+messaging.client.jar.name=jboss-messaging-client.jar
+#jboss.home=C:\\work\\src\\jboss-4.0.4.GA-src\\build\\output\\jboss-4.0.4.GA
Added: trunk/docs/examples/distributed-queue/etc/jndi.properties
===================================================================
--- trunk/docs/examples/distributed-queue/etc/jndi.properties (rev 0)
+++ trunk/docs/examples/distributed-queue/etc/jndi.properties 2007-02-13 09:24:04 UTC (rev 2285)
@@ -0,0 +1,4 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
Added: trunk/docs/examples/distributed-queue/etc/log4j.xml
===================================================================
--- trunk/docs/examples/distributed-queue/etc/log4j.xml (rev 0)
+++ trunk/docs/examples/distributed-queue/etc/log4j.xml 2007-02-13 09:24:04 UTC (rev 2285)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 536 2005-12-22 00:28:39 -0600 (Thu, 22 Dec 2005) ovidiu $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="INFO"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+</log4j:configuration>
Property changes on: trunk/docs/examples/distributed-queue/etc/log4j.xml
___________________________________________________________________
Name: svn:keywords
+ "Id LastChangedDate Author Revision"
Added: trunk/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/DistributedQueueExample.java
===================================================================
--- trunk/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/DistributedQueueExample.java (rev 0)
+++ trunk/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/DistributedQueueExample.java 2007-02-13 09:24:04 UTC (rev 2285)
@@ -0,0 +1,172 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, 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.example.jms.distributedqueue;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Queue;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+
+/**
+ * The example creates two connections to two distinct cluster nodes on which we have previously
+ * deployed a distributed queue. The example creates and sends a message using a connection, and
+ * attempts to receive the message using the other connection. This is an example of message
+ * redistribution in clustered environment at work.
+ *
+ * Since this example is also used as a smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 1001 $</tt>
+ *
+ * $Id: TopicExample.java 1001 2006-06-24 09:05:40Z timfox $
+ */
+public class DistributedQueueExample extends ExampleSupport
+{
+ public void example() throws Exception
+ {
+ String destinationName = getDestinationJNDIName();
+
+ InitialContext ic = null;
+
+ Connection connection0 = null;
+ Connection connection1 = null;
+
+ try
+ {
+ // connecting to the first node
+
+ ic = new InitialContext();
+
+ ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
+ Queue distributedQueue = (Queue)ic.lookup(destinationName);
+ log("Distributed queue " + destinationName + " exists");
+
+
+ // When connecting to a messaging cluster, the ConnectionFactory has the capability of
+ // transparently creating physical connections to different cluster nodes, in a round
+ // robin fashion ...
+
+ // ... so this is a connection to a cluster node
+ connection0 = cf.createConnection();
+
+// // ... and this is a connection to a different cluster node
+// connection1 = cf.createConnection();
+//
+// // Let's make sure that (this example is also a smoke test)
+// assertNotEquals(getServerID(connection0), getServerID(connection1));
+
+ // Create a session and a producer on the first connection
+
+ Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ MessageProducer publisher = session0.createProducer(distributedQueue);
+
+
+// // Create another session and a consumer on the second connection
+//
+// Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+// MessageConsumer consumer = session1.createConsumer(distributedQueue);
+// ExampleListener messageListener = new ExampleListener("MessageListener");
+// consumer.setMessageListener(messageListener);
+//
+// // Start connection1, so we can receive the message
+//
+// connection1.start();
+
+ // Sendi the message
+
+ TextMessage message = session0.createTextMessage("Hello!");
+ publisher.send(message);
+
+ log("The message was successfully sent to the distributed queue");
+
+
+// messageListener.waitForMessage();
+//
+//
+// message = (TextMessage)messageListener.getMessage();
+// log(messageListener.getName() + " received message: " + message.getText());
+// assertEquals("Hello!", message.getText());
+
+ displayProviderInfo(connection0.getMetaData());
+
+ }
+ finally
+ {
+ if (ic != null)
+ {
+ try
+ {
+ ic.close();
+ }
+ catch(Exception e)
+ {
+ throw e;
+ }
+ }
+
+ try
+ {
+ if (connection0 != null)
+ {
+ connection0.close();
+ }
+ }
+ catch(JMSException e)
+ {
+ log("Could not close connection " + connection0 + ", exception was " + e);
+ throw e;
+ }
+
+ try
+ {
+ if (connection1 != null)
+ {
+ connection1.close();
+ }
+ }
+ catch(JMSException e)
+ {
+ log("Could not close connection " + connection1 + ", exception was " + e);
+ throw e;
+ }
+ }
+ }
+
+ protected boolean isQueueExample()
+ {
+ return true;
+ }
+
+ public static void main(String[] args)
+ {
+ new DistributedQueueExample().run();
+ }
+
+}
Property changes on: trunk/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/DistributedQueueExample.java
___________________________________________________________________
Name: svn:keywords
+ "Id LastChangedDate Author Revision"
Added: trunk/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/ExampleListener.java
===================================================================
--- trunk/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/ExampleListener.java (rev 0)
+++ trunk/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/ExampleListener.java 2007-02-13 09:24:04 UTC (rev 2285)
@@ -0,0 +1,82 @@
+/**
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.example.jms.distributedqueue;
+
+import javax.jms.Message;
+import javax.jms.MessageListener;
+
+/**
+ * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * @version <tt>$Revision: 536 $</tt>
+
+ * $Id: ExampleListener.java 536 2005-12-22 00:28:39 -0600 (Thu, 22 Dec 2005) ovidiu $
+ */
+public class ExampleListener implements MessageListener
+{
+ // Constants ------------------------------------------------------------------------------------
+
+ // Static ---------------------------------------------------------------------------------------
+
+ // Attributes -----------------------------------------------------------------------------------
+
+ private String name;
+ private Message message;
+
+ // Constructors ---------------------------------------------------------------------------------
+
+ public ExampleListener(String name)
+ {
+ this.name = name;
+ }
+
+ // MessageListener implementation ---------------------------------------------------------------
+
+ public synchronized void onMessage(Message message)
+ {
+ this.message = message;
+ notifyAll();
+ }
+
+ // Public ---------------------------------------------------------------------------------------
+
+ public synchronized Message getMessage()
+ {
+ return message;
+ }
+
+ public synchronized void waitForMessage()
+ {
+ if (message != null)
+ {
+ return;
+ }
+
+ try
+ {
+ wait(5000);
+ }
+ catch(InterruptedException e)
+ {
+ // OK
+ }
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ // Package protected ----------------------------------------------------------------------------
+
+ // Protected ------------------------------------------------------------------------------------
+
+ // Private --------------------------------------------------------------------------------------
+
+ // Inner classes --------------------------------------------------------------------------------
+
+}
Property changes on: trunk/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/ExampleListener.java
___________________________________________________________________
Name: svn:keywords
+ "Id LastChangedDate Author Revision"
Deleted: trunk/lib/jboss-remoting.jar
===================================================================
(Binary files differ)
Modified: trunk/messaging.iml
===================================================================
--- trunk/messaging.iml 2007-02-13 06:47:23 UTC (rev 2284)
+++ trunk/messaging.iml 2007-02-13 09:24:04 UTC (rev 2285)
@@ -6,6 +6,7 @@
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/docs/examples/common/src" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/docs/examples/distributed-queue/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/docs/examples/distributed-topic/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/docs/examples/ejb3mdb/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/docs/examples/http/src" isTestSource="false" />
Modified: trunk/messaging.ipr
===================================================================
--- trunk/messaging.ipr 2007-02-13 06:47:23 UTC (rev 2284)
+++ trunk/messaging.ipr 2007-02-13 09:24:04 UTC (rev 2285)
@@ -354,7 +354,7 @@
</library>
<library name="jboss-remoting">
<CLASSES>
- <root url="jar://$PROJECT_DIR$/lib/jboss-remoting.jar!/" />
+ <root url="jar://$PROJECT_DIR$/thirdparty/jboss/remoting/lib/jboss-remoting.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
Modified: trunk/util/do-not-distribute.properties
===================================================================
--- trunk/util/do-not-distribute.properties 2007-02-13 06:47:23 UTC (rev 2284)
+++ trunk/util/do-not-distribute.properties 2007-02-13 09:24:04 UTC (rev 2285)
@@ -2,16 +2,13 @@
# This file provides values for in-workarea example testing.
# DO NOT DISTRIBUTE!
#
-<<<<<<< .working
-#jboss.home=/home/clebert/workspaces/jboss-4.0-tmp/build/output/jboss-4.0.5.GA
-=======
#jboss.home=C:\\work/src/jboss-4.0.1sp1-src/build/output/jboss-4.0.1sp1
#jboss.home=C:\\work/src/cvs/jboss-head/build/output/jboss-5.0.0.Alpha
#jboss.home=C:\\work\\src\\jboss-4.0.3SP1-src\\build\\output\\jboss-4.0.3SP1
-jboss.home=C:\\work\\src\\jboss-4.0.4.GA-src\\build\\output\\jboss-4.0.4.GA
-jboss.home=C:\\work\\src\\jboss-4.0.5.GA-src\\build\\output\\jboss-4.0.5.GA-ejb3
->>>>>>> .merge-right.r1823
-messaging.config.name=messaging
+#jboss.home=C:\\work\\src\\jboss-4.0.4.GA-src\\build\\output\\jboss-4.0.4.GA
+#jboss.home=C:\\work\\src\\jboss-4.0.5.GA-src\\build\\output\\jboss-4.0.5.GA-ejb3
+
+#messaging.config.name=messaging
main.artifact.location=../output/lib
auxiliary.artifacts.location=../src/etc/server/default/deploy
messaging.artifact.name=jboss-messaging-scoped.sar
Modified: trunk/util/release-admin.xml
===================================================================
--- trunk/util/release-admin.xml 2007-02-13 06:47:23 UTC (rev 2284)
+++ trunk/util/release-admin.xml 2007-02-13 09:24:04 UTC (rev 2285)
@@ -463,7 +463,7 @@
<target name="configure-service-binding-manager" if="ports">
<!--
- Enable the service binding manager.
+ Enable the service binding manager, by deleting XML comment tags.
-->
<replaceregexp file="${jboss.home}/server/${config.name}/conf/jboss-service.xml" flags="s">
<regexp pattern="(\x3cmbean[ \t]*code=\x22org.jboss.services.binding.ServiceBindingManager\x22.+org.jboss.services.binding.XMLServicesStoreFactory[ \t\n\r]*\x3c/attribute\x3e[ \t\n\r]*\x3c/mbean\x3e[ \t\n\r]*)--\x3e"/>
More information about the jboss-cvs-commits
mailing list