You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by bu...@apache.org on 2011/10/26 18:55:10 UTC

svn commit: r797507 - /websites/staging/openejb/trunk/content/jms-resources-and-mdb-container.html

Author: buildbot
Date: Wed Oct 26 16:55:09 2011
New Revision: 797507

Log:
Staging update by buildbot

Modified:
    websites/staging/openejb/trunk/content/jms-resources-and-mdb-container.html

Modified: websites/staging/openejb/trunk/content/jms-resources-and-mdb-container.html
==============================================================================
--- websites/staging/openejb/trunk/content/jms-resources-and-mdb-container.html (original)
+++ websites/staging/openejb/trunk/content/jms-resources-and-mdb-container.html Wed Oct 26 16:55:09 2011
@@ -159,9 +159,7 @@
 
             <!--welcome -->
             <section>
-                <p><a name="JMSResourcesandMDBContainer-ExternalActiveMQBroker"></a></p>
-
-<h1>External ActiveMQ Broker</h1>
+                <h1>External ActiveMQ Broker</h1>
 
 <pre><code>&lt;openejb&gt;
     &lt;Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter"&gt;
@@ -187,15 +185,39 @@
 ActiveMQ process.  The various URL formats that ActiveMQ supports also
 work, such as 'failover:'.</p>
 
+<h1>Internal ActiveMQ Broker</h1>
+
+<pre><code>&lt;openejb&gt;
+    &lt;Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter"&gt;
+        BrokerXmlConfig =  broker:(tcp://someHostName:61616)
+        ServerUrl       =  tcp://someHostName:61616
+    &lt;/Resource&gt;
+
+    &lt;Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory"&gt;
+        ResourceAdapter MyJmsResourceAdapter
+    &lt;/Resource&gt;
+
+    &lt;Container id="MyJmsMdbContainer" ctype="MESSAGE"&gt;
+        ResourceAdapter MyJmsResourceAdapter
+    &lt;/Container&gt;
+
+    &lt;Resource id="FooQueue" type="javax.jms.Queue"/&gt;
+    &lt;Resource id="BarTopic" type="javax.jms.Topic"/&gt;
+&lt;/openejb&gt;
+</code></pre>
+
+<p>The <code>BrokerXmlConfig</code> tells ActiveMQ to start on the tcp host/port <code>someHostName</code> and <code>61616</code></p>
+
+<h1>Configuration via System properties</h1>
+
 <p>The same can be done via properties in an embedded configuration, via the
-{{conf/system.properties}} file or on the command line via {{-D}} flags.</p>
+<code>conf/system.properties</code> file or on the command line via <code>-D</code> flags.</p>
 
 <pre><code>Properties p = new Properties();
 p.put(Context.INITIAL_CONTEXT_FACTORY, LocalInitialContextFactory.class.getName());
 
 p.put("MyJmsResourceAdapter", "new://Resource?type=ActiveMQResourceAdapter");
 p.put("MyJmsResourceAdapter.ServerUrl", "tcp://someHostName:61616");
-// Do not start the ActiveMQ broker
 p.put("MyJmsResourceAdapter.BrokerXmlConfig", "");
 
 p.put("MyJmsConnectionFactory", "new://Resource?type=javax.jms.ConnectionFactory");
@@ -210,6 +232,8 @@ p.put("BarTopic", "new://Resource?type=j
 InitialContext context = new InitialContext(p);
 </code></pre>
 
+<h1>Global lookup of JMS Resources</h1>
+
 <p>From anywhere in the same VM as the EJB Container you could lookup the
 above resources like so:</p>
 
@@ -220,11 +244,6 @@ javax.jms.Queue queue = (Queue) context.
 javax.jms.Topic topic = (Topic) context.lookup("openejb:Resource/BarTopic");
 </code></pre>
 
-<h1>Internal ActiveMQ Broker</h1>
-
-<pre><code>_TODO_
-</code></pre>
-
             </section>
 
             <!--News -->