You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by bu...@apache.org on 2013/07/09 22:22:12 UTC

svn commit: r868954 - in /websites/production/activemq/content: cache/main.pageCache stomp.html

Author: buildbot
Date: Tue Jul  9 20:22:12 2013
New Revision: 868954

Log:
Production update by buildbot for activemq

Modified:
    websites/production/activemq/content/cache/main.pageCache
    websites/production/activemq/content/stomp.html

Modified: websites/production/activemq/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/activemq/content/stomp.html
==============================================================================
--- websites/production/activemq/content/stomp.html (original)
+++ websites/production/activemq/content/stomp.html Tue Jul  9 20:22:12 2013
@@ -50,8 +50,8 @@
       <div>
 
 <!-- Banner -->
-
-	<div id="asf_logo">
+<p>
+	</p><div id="asf_logo">
 	<div id="activemq_logo">
             <a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a> &#8482;
             <a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
@@ -82,17 +82,17 @@
 
 <p>Its very easy to enable ActiveMQ for Stomp. Just add a connector to the broker using the stomp URL.</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 &lt;transportConnectors&gt;
-   &lt;transportConnector name=<span class="code-quote">"stomp"</span> uri=<span class="code-quote">"stomp:<span class="code-comment">//localhost:61613"</span>/&gt;
-</span>&lt;/transportConnectors&gt;
-</pre>
+   &lt;transportConnector name="stomp" uri="stomp://localhost:61613"/&gt;
+&lt;/transportConnectors&gt;
+]]></script>
 </div></div>
 <p>To see a full example, try <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/activemq/trunk/assembly/src/release/example/conf/activemq.xml">this XML</a>. If you save that XML as foo.xml then you can run stomp via the command line as</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 activemq xbean:foo.xml
-</pre>
+]]></script>
 </div></div>
 
 <p>For more help see <a shape="rect" href="run-broker.html" title="Run Broker">Run Broker</a>.</p>
@@ -110,9 +110,9 @@ activemq xbean:foo.xml
 <p>For better scalability (and performance) you might want to run Stomp protocol over NIO transport. To do that just use <tt>stomp+nio</tt> transport prefix instead of <tt>stomp</tt>. For example, add the following transport configuration in your XML file</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-     <span class="code-tag">&lt;transportConnector name=<span class="code-quote">"stomp+nio"</span> uri=<span class="code-quote">"stomp+nio://localhost:61612"</span>/&gt;</span>
-</pre>
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+     &lt;transportConnector name="stomp+nio" uri="stomp+nio://localhost:61612"/&gt;
+]]></script>
 </div></div>
 
 <p>This transport use <a shape="rect" class="external-link" href="http://activemq.apache.org/configuring-transports.html#ConfiguringTransports-TheNIOTransport">NIO transport</a> underneath and will generally use much less threads than standard connector. This connector can help if you want to use <a shape="rect" class="external-link" href="http://activemq.apache.org/how-do-i-configure-10s-of-1000s-of-queues-in-a-single-broker-.html">large number of queues</a></p>
@@ -124,9 +124,9 @@ activemq xbean:foo.xml
 <p>It's easy to configure ActiveMQ to use Stomp over SSL connection. All you have to do is use <tt>stomp+ssl</tt> transport prefix instead of <tt>stomp</tt>. For example, add the following transport configuration in your XML file</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-     <span class="code-tag">&lt;transportConnector name=<span class="code-quote">"stomp+ssl"</span> uri=<span class="code-quote">"stomp+ssl://localhost:61612"</span>/&gt;</span>
-</pre>
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+     &lt;transportConnector name="stomp+ssl" uri="stomp+ssl://localhost:61612"/&gt;
+]]></script>
 </div></div>
 
 <ul><li>For more details on using SSL with ActiveMQ see the following article (<a shape="rect" class="external-link" href="http://activemq.apache.org/how-do-i-use-ssl.html">How do I use SSL</a>).</li><li>Example of using Stomp over SSL on the client side could be found in the <a shape="rect" class="external-link" href="http://stomp.fusesource.org/documentation/php/book.html#SSL" rel="nofollow">PHP Stomp client example </a>.</li></ul>
@@ -157,36 +157,36 @@ activemq xbean:foo.xml
 <p>Here's a quick example of how to use built-in transformer (taken from test cases)</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 
-    <span class="code-keyword">private</span> <span class="code-object">String</span> xmlObject = <span class="code-quote">"&lt;pojo&gt;\n"</span> 
-            + <span class="code-quote">"  &lt;name&gt;Dejan&lt;/name&gt;\n"</span>
-            + <span class="code-quote">"  &lt;city&gt;Belgrade&lt;/city&gt;\n"</span> 
-            + <span class="code-quote">"&lt;/pojo&gt;"</span>;
+    private String xmlObject = "&lt;pojo&gt;\n" 
+            + "  &lt;name&gt;Dejan&lt;/name&gt;\n"
+            + "  &lt;city&gt;Belgrade&lt;/city&gt;\n" 
+            + "&lt;/pojo&gt;";
 
-    <span class="code-keyword">public</span> void testTransformationReceiveXMLObject() <span class="code-keyword">throws</span> Exception {
+    public void testTransformationReceiveXMLObject() throws Exception {
     	
-        MessageProducer producer = session.createProducer(<span class="code-keyword">new</span> ActiveMQQueue(<span class="code-quote">"USERS."</span> + getQueueName()));
-        ObjectMessage message = session.createObjectMessage(<span class="code-keyword">new</span> SamplePojo(<span class="code-quote">"Dejan"</span>, <span class="code-quote">"Belgrade"</span>));
+        MessageProducer producer = session.createProducer(new ActiveMQQueue("USERS." + getQueueName()));
+        ObjectMessage message = session.createObjectMessage(new SamplePojo("Dejan", "Belgrade"));
         producer.send(message);
     	
-        <span class="code-object">String</span> frame = <span class="code-quote">"CONNECT\n"</span> + <span class="code-quote">"login: system\n"</span> + <span class="code-quote">"passcode: manager\n\n"</span> + Stomp.NULL;
+        String frame = "CONNECT\n" + "login: system\n" + "passcode: manager\n\n" + Stomp.NULL;
         stompConnection.sendFrame(frame);
 
         frame = stompConnection.receiveFrame();
-        assertTrue(frame.startsWith(<span class="code-quote">"CONNECTED"</span>));
+        assertTrue(frame.startsWith("CONNECTED"));
 
-        frame = <span class="code-quote">"SUBSCRIBE\n"</span> + <span class="code-quote">"destination:/queue/USERS."</span> + getQueueName() + <span class="code-quote">"\n"</span> + <span class="code-quote">"ack:auto"</span> + <span class="code-quote">"\n"</span> + <span class="code-quote">"transformation:jms-object-xml\n\n"</span> + Stomp.NULL;
+        frame = "SUBSCRIBE\n" + "destination:/queue/USERS." + getQueueName() + "\n" + "ack:auto" + "\n" + "transformation:jms-object-xml\n\n" + Stomp.NULL;
         stompConnection.sendFrame(frame);
         
         frame = stompConnection.receiveFrame();
 
         assertTrue(frame.trim().endsWith(xmlObject));
         
-        frame = <span class="code-quote">"DISCONNECT\n"</span> + <span class="code-quote">"\n\n"</span> + Stomp.NULL;
+        frame = "DISCONNECT\n" + "\n\n" + Stomp.NULL;
         stompConnection.sendFrame(frame);
     }     
-</pre>
+]]></script>
 </div></div>
 
 <div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Dependencies</b><br clear="none">ActiveMQ uses <a shape="rect" class="external-link" href="http://xstream.codehaus.org" rel="nofollow">XStream</a> for its transformation needs. Since it's the optional dependency you have to add it to broker's classpath by putting the appropriate JAR into the <tt>lib/</tt> folder. Additionally, if you plan to use JSON transformations you have to add <a shape="rect" class="external-link" href="http://jettison.codehaus.org/" rel="nofollow">Jettison</a> JSON parser to the classpath.</td></tr></table></div>
@@ -199,7 +199,7 @@ activemq xbean:foo.xml
 <p>For example the built-in transformer contains the following value</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">class=org.apache.activemq.transport.stomp.XStreamFrameTranslator</pre>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[class=org.apache.activemq.transport.stomp.XStreamFrameTranslator]]></script>
 </div></div>
 
 <p>in the <tt>META-INF/services/org/apache/activemq/transport/frametranslator/jms-xml</tt> file.</p>
@@ -218,11 +218,11 @@ activemq xbean:foo.xml
 <p>In case you want to debug Stomp communication between broker and clients you should configure the Stomp connector with the <tt>trace</tt> parameter, like this:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 &lt;transportConnectors&gt;
-   &lt;transportConnector name=<span class="code-quote">"stomp"</span> uri=<span class="code-quote">"stomp:<span class="code-comment">//localhost:61613?trace=<span class="code-keyword">true</span>"</span>/&gt;
-</span>&lt;/transportConnectors&gt;
-</pre>
+   &lt;transportConnector name="stomp" uri="stomp://localhost:61613?trace=true"/&gt;
+&lt;/transportConnectors&gt;
+]]></script>
 </div></div>
 
 <p>This will instruct the broker to trace all packets it sends and receives.</p>
@@ -230,28 +230,31 @@ activemq xbean:foo.xml
 <p>Furthermore, you have to enable tracing for the appropriate log. You can achieve that by adding the following to your <tt>conf/log4j.properties</tt></p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 log4j.logger.org.apache.activemq.transport.stomp=TRACE
-</pre>
+]]></script>
 </div></div>
 
 <p>Finally, you will probably want to keep these messages in the separate file instead of polluting the standard broker's log. You can achieve that with the following log4j configuration:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 log4j.appender.stomp=org.apache.log4j.RollingFileAppender
 log4j.appender.stomp.file=${activemq.base}/data/stomp.log
 log4j.appender.stomp.maxFileSize=1024KB
 log4j.appender.stomp.maxBackupIndex=5
-log4j.appender.stomp.append=<span class="code-keyword">true</span>
+log4j.appender.stomp.append=true
 log4j.appender.stomp.layout=org.apache.log4j.PatternLayout
 log4j.appender.stomp.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
 
 log4j.logger.org.apache.activemq.transport.stomp=TRACE, stomp
-# enable <span class="code-keyword">this</span> line and disable the above <span class="code-keyword">if</span> you just want the frame IO.
+log4j.additivity.org.apache.activemq.transport.stomp=false
+
+# Enable these two lines and disable the above two if you want the
+frame IO ONLY (e.g., no heart beat messages, inactivity monitor etc).
 #log4j.logger.org.apache.activemq.transport.stomp.StompIO=TRACE, stomp
-log4j.additivity.org.apache.activemq.transport.stomp=<span class="code-keyword">false</span>
-</pre>
+#log4j.additivity.org.apache.activemq.transport.stomp.StompIO=false
+]]></script>
 </div></div>
 
 <p>After this, all your Stomp packets will be logged to the <tt>data/stomp.log</tt></p>
@@ -261,45 +264,45 @@ log4j.additivity.org.apache.activemq.tra
 <p>Since version 5.2, there is a simple Java Stomp API distributed with ActiveMQ. Note that this API is provided purely for testing purposes and you should always consider using standard JMS API from Java instead of this one. The following code snippet provides a simple example of using this API:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-StompConnection connection = <span class="code-keyword">new</span> StompConnection();
-connection.open(<span class="code-quote">"localhost"</span>, 61613);
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+StompConnection connection = new StompConnection();
+connection.open("localhost", 61613);
 		
-connection.connect(<span class="code-quote">"system"</span>, <span class="code-quote">"manager"</span>);
+connection.connect("system", "manager");
 StompFrame connect = connection.receive();
-<span class="code-keyword">if</span> (!connect.getAction().equals(Stomp.Responses.CONNECTED)) {
-	<span class="code-keyword">throw</span> <span class="code-keyword">new</span> Exception (<span class="code-quote">"Not connected"</span>);
+if (!connect.getAction().equals(Stomp.Responses.CONNECTED)) {
+	throw new Exception ("Not connected");
 }
 		
-connection.begin(<span class="code-quote">"tx1"</span>);
-connection.send(<span class="code-quote">"/queue/test"</span>, <span class="code-quote">"message1"</span>, <span class="code-quote">"tx1"</span>, <span class="code-keyword">null</span>);
-connection.send(<span class="code-quote">"/queue/test"</span>, <span class="code-quote">"message2"</span>, <span class="code-quote">"tx1"</span>, <span class="code-keyword">null</span>);
-connection.commit(<span class="code-quote">"tx1"</span>);
+connection.begin("tx1");
+connection.send("/queue/test", "message1", "tx1", null);
+connection.send("/queue/test", "message2", "tx1", null);
+connection.commit("tx1");
 	
-connection.subscribe(<span class="code-quote">"/queue/test"</span>, Subscribe.AckModeValues.CLIENT);
+connection.subscribe("/queue/test", Subscribe.AckModeValues.CLIENT);
 	
-connection.begin(<span class="code-quote">"tx2"</span>);
+connection.begin("tx2");
 	
 StompFrame message = connection.receive();
-<span class="code-object">System</span>.out.println(message.getBody());
-connection.ack(message, <span class="code-quote">"tx2"</span>);
+System.out.println(message.getBody());
+connection.ack(message, "tx2");
 	
 message = connection.receive();
-<span class="code-object">System</span>.out.println(message.getBody());
-connection.ack(message, <span class="code-quote">"tx2"</span>);
+System.out.println(message.getBody());
+connection.ack(message, "tx2");
 	
-connection.commit(<span class="code-quote">"tx2"</span>);
+connection.commit("tx2");
 		
 connection.disconnect();
-</pre>
+]]></script>
 </div></div>
 
 <p>This example is distributed with the ActiveMQ distribution. You can run it from the <tt>example</tt> folder with</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 ant stomp
-</pre>
+]]></script>
 </div></div>
 
 <h3><a shape="rect" name="Stomp-StompextensionsforJMSmessagesemantics"></a>Stomp extensions for JMS message semantics</h3>
@@ -335,8 +338,8 @@ ant stomp
 
 <h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
 
-
-<div>
+<p>
+</p><div>
 <form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
 <input type="hidden" name="ie" value="UTF-8">
 <input type="hidden" name="oe" value="UTF-8">