<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Usage</title><link>https://sourceforge.net/p/projms/wiki/Usage/</link><description>Recent changes to Usage</description><atom:link href="https://sourceforge.net/p/projms/wiki/Usage/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 29 Oct 2012 09:10:56 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/projms/wiki/Usage/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage Usage modified by haukepauke</title><link>https://sourceforge.net/p/projms/wiki/Usage/</link><description>&lt;pre&gt;--- v14
+++ v15
@@ -26,7 +26,7 @@
 ~~~~~~
 
 
-The first parameter of the constructor of publisher is the [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier) of the messaging broker the Publisher connects to. When using the peer protocol as in the example above, the Publisher will start it's own broker which will connect with every other broker in the same network with the same group ("group1")  specified. The function call *UUID.randomUUID().toString()* creates an random string for the id of the Consumer. This is a good way to go most of the time because there can't be two Consumers with the same id in a group and there might be the use case that you want to start several Consumers without having to configure the client id in a static way for every instance. But you can also choose your own id with using a random function. "peer://group2/consumer1" would be a valid URI as well.
+The first parameter of the constructor of publisher is the [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier) of the messaging broker the Publisher connects to. When using the peer protocol as in the example above, the Publisher will start it's own broker which will connect with every other broker in the same network with the same group ("group1")  specified. The function call *UUID.randomUUID().toString()* creates an random string for the id of the Consumer. This is a good way to go most of the time because there can't be two Consumers with the same id in a group and there might be the use case that you want to start several Consumers without having to configure the client id in a static way for every instance. But you can also choose your own id without using a random function. "peer://group2/consumer1" would be a valid URI as well.
 
 If you want to connect to an existing broker, f.e. if the Consumers are on another network, you can specify a different URI here. Please refer to the [transport configuration documentation](https://activemq.apache.org/configuring-transports.html) on the ActiveMQ website.
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">haukepauke</dc:creator><pubDate>Mon, 29 Oct 2012 09:10:56 -0000</pubDate><guid>https://sourceforge.net83201a56053f17f41447b08d52d80fabd83363ce</guid></item><item><title>WikiPage Usage modified by haukepauke</title><link>https://sourceforge.net/p/projms/wiki/Usage/</link><description>&lt;pre&gt;--- v13
+++ v14
@@ -26,7 +26,7 @@
 ~~~~~~
 
 
-The first parameter of the constructor of publisher is the [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier) of the messaging broker the Publisher connects to. When using the peer protocol as in the example above, the Publisher will start it's own broker which will connect with every other broker in the same network with the same group ("group1")  specified. The function call *UUID.randomUUID().toString()* creates an random string for the id of the Consumer. This is a good way to go most of the time because there can't be two Consumers with the same id in a group and for most usecases the id of the client is not need to be known by applications communicating with it. But you can also choose your own id with using a random function. "peer://group2/consumer1" would be a valid URI as well.
+The first parameter of the constructor of publisher is the [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier) of the messaging broker the Publisher connects to. When using the peer protocol as in the example above, the Publisher will start it's own broker which will connect with every other broker in the same network with the same group ("group1")  specified. The function call *UUID.randomUUID().toString()* creates an random string for the id of the Consumer. This is a good way to go most of the time because there can't be two Consumers with the same id in a group and there might be the use case that you want to start several Consumers without having to configure the client id in a static way for every instance. But you can also choose your own id with using a random function. "peer://group2/consumer1" would be a valid URI as well.
 
 If you want to connect to an existing broker, f.e. if the Consumers are on another network, you can specify a different URI here. Please refer to the [transport configuration documentation](https://activemq.apache.org/configuring-transports.html) on the ActiveMQ website.
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">haukepauke</dc:creator><pubDate>Mon, 29 Oct 2012 09:10:12 -0000</pubDate><guid>https://sourceforge.net59bb984778fd704fde972226b063c265505fb8dd</guid></item><item><title>WikiPage Usage modified by haukepauke</title><link>https://sourceforge.net/p/projms/wiki/Usage/</link><description>&lt;pre&gt;--- v12
+++ v13
@@ -12,6 +12,7 @@
 ~~~~~~
 :::java
 import projms.publisher.Publisher;
+import java.util.UUID;
 
 Publisher messagePublisher;
 ~~~~~~
@@ -60,6 +61,7 @@
 ~~~~~~
 :::java
 import projms.consumer.Consumer;
+import java.util.UUID;
 
 Consumer messageConsumer;
 ~~~~~~
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">haukepauke</dc:creator><pubDate>Mon, 29 Oct 2012 09:07:43 -0000</pubDate><guid>https://sourceforge.net46b12c3e938260c37b486cfec8e7598e3752e02d</guid></item><item><title>WikiPage Usage modified by haukepauke</title><link>https://sourceforge.net/p/projms/wiki/Usage/</link><description>&lt;pre&gt;--- v11
+++ v12
@@ -99,7 +99,7 @@
 For this scenario you will need to use a different protocol. ActiveMQ offers a variety of protocols that can be used. To keep this documentation short we will only explain the usage of the TCP and the HTTP protocol. Please refer to the [ActiveMQ transport configuration](https://activemq.apache.org/configuring-transports.html) section if you want to use another protocol or if you want to know more details about it.
 
 ### Using the TCP Protocol ###
-If you don't have an ActiveMQ messaging broker up and running (or know the URI of one someone else runs), read the "Installing your own ActiveMQ broker" section first.
+If you don't have an ActiveMQ messaging broker up and running (or know the URI of one someone else runs), read the [ActiveMQ Getting started section](https://activemq.apache.org/version-5-getting-started.html) first to install and run your own messaging broker.
 
 The tcp protocol is the default protocol used by ActivMQ to connect Publishers and Consumers with the message broker. Initializing a Publisher or consumer is straightforward if you know the URI:
 
@@ -122,7 +122,7 @@
 If your router firewall is configured more strict it could happen that connections to that port with that protocol are blocked. In that case you can try using the HTTP protocol, described in the next section.
 
 ### Using the HTTP Protocol ###
-If you don't have an ActiveMQ messaging broker up and running (or know the URI of one someone else runs), read the "Installing your own ActiveMQ broker" section first.
+If you don't have an ActiveMQ messaging broker up and running (or know the URI of one someone else runs), read the [ActiveMQ Getting started section](https://activemq.apache.org/version-5-getting-started.html) first to install and run your own messaging broker.
 
 If you want to use the HTTP protocol with proJMS you'll need to install some more Java libraries first. Please have a look at the [Installation] page and install the optional HTTP Client and XStream libraries there. 
 
@@ -159,6 +159,4 @@
 ~~~~~~
 
 
-### Installing your own ActiveMQ messaging broker ###
-Please refer to the [ActiveMQ Getting started section](https://activemq.apache.org/version-5-getting-started.html) for documentation how to setup an run an ActiveMQ Messaging broker.
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">haukepauke</dc:creator><pubDate>Mon, 29 Oct 2012 08:55:49 -0000</pubDate><guid>https://sourceforge.net04a28c0c37dfb62d308a2dae68124c53e934f5ad</guid></item><item><title>WikiPage Usage modified by haukepauke</title><link>https://sourceforge.net/p/projms/wiki/Usage/</link><description>&lt;pre&gt;--- v10
+++ v11
@@ -142,6 +142,23 @@
 &lt;/broker&gt; 
 ~~~~~~
 
+If you got a broker with HTTP enabled running on *yourdomain.org*, you can initialize Publishers and Consumers like this:
+
+~~~~~~
+:::java
+messagePublisher = new Publisher("http://yourdomain.org:8080", this);
+~~~~~~
+
+and:
+
+~~~~~~
+:::java
+messageConsumer = new Consumer(
+    this, "http://yourdomain.org:8080", "EXAMPLE_TOPIC"
+);
+~~~~~~
+
+
 ### Installing your own ActiveMQ messaging broker ###
 Please refer to the [ActiveMQ Getting started section](https://activemq.apache.org/version-5-getting-started.html) for documentation how to setup an run an ActiveMQ Messaging broker.
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">haukepauke</dc:creator><pubDate>Mon, 29 Oct 2012 08:54:01 -0000</pubDate><guid>https://sourceforge.net4a162c86a25a451f0ff58ad7060ccfeae3b49523</guid></item><item><title>WikiPage Usage modified by haukepauke</title><link>https://sourceforge.net/p/projms/wiki/Usage/</link><description>&lt;pre&gt;--- v9
+++ v10
@@ -130,6 +130,7 @@
 [ActiveMQ transport configuration section](https://activemq.apache.org/configuring-transports.html) for that.
 
 You will need to add a HTTP *transportConnector* to your *activemq.conf* file:
+
 ~~~~~~
 :::xml
 &lt;broker&gt;
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">haukepauke</dc:creator><pubDate>Mon, 29 Oct 2012 08:51:13 -0000</pubDate><guid>https://sourceforge.neta323489e8aefb6e646730f5de46607691bd6bf2f</guid></item><item><title>WikiPage Usage modified by haukepauke</title><link>https://sourceforge.net/p/projms/wiki/Usage/</link><description>&lt;pre&gt;--- v8
+++ v9
@@ -98,12 +98,49 @@
 
 For this scenario you will need to use a different protocol. ActiveMQ offers a variety of protocols that can be used. To keep this documentation short we will only explain the usage of the TCP and the HTTP protocol. Please refer to the [ActiveMQ transport configuration](https://activemq.apache.org/configuring-transports.html) section if you want to use another protocol or if you want to know more details about it.
 
-### Installing your own ActiveMQ messaging broker ###
+### Using the TCP Protocol ###
+If you don't have an ActiveMQ messaging broker up and running (or know the URI of one someone else runs), read the "Installing your own ActiveMQ broker" section first.
 
+The tcp protocol is the default protocol used by ActivMQ to connect Publishers and Consumers with the message broker. Initializing a Publisher or consumer is straightforward if you know the URI:
 
-### Using the TCP Protocol ###
-The tcp protocol is the default protocol used by ActivMQ to connect Publishers and Consumers with the message broker. 
+~~~~~~
+:::java
+messagePublisher = new Publisher("tcp://yourdomain.org:61616", this);
+~~~~~~
+
+and:
+
+~~~~~~
+:::java
+messageConsumer = new Consumer(
+    this, "tcp://yourdomain.org:61616", "EXAMPLE_TOPIC"
+);
+~~~~~~
+
+In the example above your Publisher object will connect to a messaging broker at yourdomain.org running on port 61616 (which is the default port of this protocol). If a messaging broker is running there and the router firewall of the network your running the sketch in is allowing connections to that port using that protocol, you're finished.
+
+If your router firewall is configured more strict it could happen that connections to that port with that protocol are blocked. In that case you can try using the HTTP protocol, described in the next section.
 
 ### Using the HTTP Protocol ###
+If you don't have an ActiveMQ messaging broker up and running (or know the URI of one someone else runs), read the "Installing your own ActiveMQ broker" section first.
 
+If you want to use the HTTP protocol with proJMS you'll need to install some more Java libraries first. Please have a look at the [Installation] page and install the optional HTTP Client and XStream libraries there. 
 
+You also need to activated the HTTP transport connector on your ActiveMQ messaging broker. Refer to the 
+[ActiveMQ transport configuration section](https://activemq.apache.org/configuring-transports.html) for that.
+
+You will need to add a HTTP *transportConnector* to your *activemq.conf* file:
+~~~~~~
+:::xml
+&lt;broker&gt;
+  ...
+  &lt;transportConnectors&gt;
+    &lt;transportConnector name="http" uri="http://0.0.0.0:8080"/&gt;  
+  &lt;/&lt;transportConnectors&gt;
+  ...
+&lt;/broker&gt; 
+~~~~~~
+
+### Installing your own ActiveMQ messaging broker ###
+Please refer to the [ActiveMQ Getting started section](https://activemq.apache.org/version-5-getting-started.html) for documentation how to setup an run an ActiveMQ Messaging broker.
+
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">haukepauke</dc:creator><pubDate>Mon, 29 Oct 2012 08:50:32 -0000</pubDate><guid>https://sourceforge.net9e8a82d018c8ca8afa1ae160a03536e22c958d51</guid></item><item><title>WikiPage Usage modified by haukepauke</title><link>https://sourceforge.net/p/projms/wiki/Usage/</link><description>&lt;pre&gt;--- v7
+++ v8
@@ -1,14 +1,12 @@
-Usage
-=====
+# Usage #
 
-Jargon
-------
+
+## Jargon ##
 proJMS allows to *publish* messages. Each message published can be received by one or more *Consumer*. To connect *Publishers* and *Consumers*, *Topics* are used. When you send a message, you'll have to specify the *Topic* that message belongs to. Every *Consumer* that subscribed to this *Topic* will then receive the message.
 
 A message must be of a *Type*. When a *Consumer* receives a message it can decide based on the *Type* of the message what to do with it.
 
-Publishing messages
--------------------
+## Publishing messages ##
 First import the Publisher class from the pro JMS library and create a Publisher object.
 
 ~~~~~~
@@ -38,10 +36,10 @@
 ~~~~~~
 :::java
 void mousePressed() {
-	 //sends a message of the type "messageType" to all consumers 
-         //that listen on the "messagingTopic"
+	 //sends a message of the type "EXAMPLE_TYPE" to all consumers 
+         //that listen on the "EXAMPLE_TOPIC"
 	 messagePublisher.sendMessage(
-            "Mouse has been pressed", messageType, messagingTopic
+            "Mouse has been pressed", "EXAMPLE_TYPE", "EXAMPLE_TOPIC"
          );
 }
 ~~~~~~
@@ -53,8 +51,10 @@
 
 The topic can be any string. Make sure that the consumers that should get the message are subscribed to this topic.
 
-Receiving messages
-------------------
+
+Please have a look at the example sketches in the "examples" folder of the proJMS zip file for the full example.
+
+## Receiving messages ##
 First import the Consumer class from the proJMS library and create a Consumer object:
 
 ~~~~~~
@@ -70,7 +70,7 @@
 ~~~~~~
 :::java
 messageConsumer = new Consumer(
-    this, "peer://group1/" + UUID.randomUUID().toString(), messagingTopic
+    this, "peer://group1/" + UUID.randomUUID().toString(), "EXAMPLE_TOPIC"
 );
 ~~~~~~
 
@@ -91,5 +91,19 @@
 
 You can check the type of the message to handle different message types in a different way.
 
+## USING proJMS with applications in different networks ##
+It is necessary for this scenario to connect to a standalone messaging broker. If you are not running one already, it is necessary to set one up. A standard AtiveMQ messaging broker can be set up pretty easy if you've got some basic knowledge of the unix shell. However, i've got to admit that this is a more advanced issue.
 
-Please have a look at the example sketches in the "examples" folder of the proJMS zip file.
+Out of the box proJMS will allow you to connect your processing applications that reside in the same network. To make this possible, every application starts it's own ActiveMQ messaging broker. The brokers then connect using the peer protocol. In most cases this will not work anymore if you want to connect applications that run in different networks connected through a router because the messages using the peer protocol won't pass the router firewall.
+
+For this scenario you will need to use a different protocol. ActiveMQ offers a variety of protocols that can be used. To keep this documentation short we will only explain the usage of the TCP and the HTTP protocol. Please refer to the [ActiveMQ transport configuration](https://activemq.apache.org/configuring-transports.html) section if you want to use another protocol or if you want to know more details about it.
+
+### Installing your own ActiveMQ messaging broker ###
+
+
+### Using the TCP Protocol ###
+The tcp protocol is the default protocol used by ActivMQ to connect Publishers and Consumers with the message broker. 
+
+### Using the HTTP Protocol ###
+
+
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">haukepauke</dc:creator><pubDate>Mon, 29 Oct 2012 08:18:31 -0000</pubDate><guid>https://sourceforge.net04101bc0fdd5748ceb10be710f4ca8860131e191</guid></item><item><title>WikiPage Usage modified by haukepauke</title><link>https://sourceforge.net/p/projms/wiki/Usage/</link><description>&lt;pre&gt;--- v6
+++ v7
@@ -27,7 +27,7 @@
 ~~~~~~
 
 
-The first parameter of the constructor of publisher is the URI of the messaging broker the Publisher connects to. When using the peer protocol as in the example above. The Publisher will start it's own broker which will connect with every other broker in the same network with the same group specified.
+The first parameter of the constructor of publisher is the [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier) of the messaging broker the Publisher connects to. When using the peer protocol as in the example above, the Publisher will start it's own broker which will connect with every other broker in the same network with the same group ("group1")  specified. The function call *UUID.randomUUID().toString()* creates an random string for the id of the Consumer. This is a good way to go most of the time because there can't be two Consumers with the same id in a group and for most usecases the id of the client is not need to be known by applications communicating with it. But you can also choose your own id with using a random function. "peer://group2/consumer1" would be a valid URI as well.
 
 If you want to connect to an existing broker, f.e. if the Consumers are on another network, you can specify a different URI here. Please refer to the [transport configuration documentation](https://activemq.apache.org/configuring-transports.html) on the ActiveMQ website.
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">haukepauke</dc:creator><pubDate>Mon, 29 Oct 2012 07:52:40 -0000</pubDate><guid>https://sourceforge.netaf0f2d0a645cb4acd18b7729640bcf9acc4cbf4c</guid></item><item><title>WikiPage Usage modified by haukepauke</title><link>https://sourceforge.net/p/projms/wiki/Usage/</link><description>&lt;pre&gt;--- v5
+++ v6
@@ -12,6 +12,7 @@
 First import the Publisher class from the pro JMS library and create a Publisher object.
 
 ~~~~~~
+:::java
 import projms.publisher.Publisher;
 
 Publisher messagePublisher;
@@ -21,6 +22,7 @@
 In the setup function, initialize the Publisher:
 
 ~~~~~~
+:::java
 messagePublisher = new Publisher("peer://group1/" + UUID.randomUUID().toString(), this);
 ~~~~~~
 
@@ -34,9 +36,13 @@
 Sending a message:
 
 ~~~~~~
+:::java
 void mousePressed() {
-	 //sends a message of the type "messageType" to all consumers that listen on the "messagingTopic"
-	 messagePublisher.sendMessage("Mouse has been pressed", messageType, messagingTopic);
+	 //sends a message of the type "messageType" to all consumers 
+         //that listen on the "messagingTopic"
+	 messagePublisher.sendMessage(
+            "Mouse has been pressed", messageType, messagingTopic
+         );
 }
 ~~~~~~
 
@@ -52,6 +58,7 @@
 First import the Consumer class from the proJMS library and create a Consumer object:
 
 ~~~~~~
+:::java
 import projms.consumer.Consumer;
 
 Consumer messageConsumer;
@@ -61,13 +68,17 @@
 In the setup function initialize the Consumer, specifying the broker to connect to and the topic to listen to.
 
 ~~~~~~
-messageConsumer = new Consumer(this, "peer://group1/" + UUID.randomUUID().toString(), messagingTopic);
+:::java
+messageConsumer = new Consumer(
+    this, "peer://group1/" + UUID.randomUUID().toString(), messagingTopic
+);
 ~~~~~~
 
 
 To receive messages you need to implement the function *onMessageArrival* in your sketch. This method will be called every time a message arrives.
 
 ~~~~~~
+:::java
 //Whenever a message arrives this method is called
 void onMessageArrival(String messageText, String messageType){
 	//different message types can be handled differently here
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">haukepauke</dc:creator><pubDate>Mon, 29 Oct 2012 07:43:21 -0000</pubDate><guid>https://sourceforge.nete8242e6e2e9203a352829deb81c99ddc18d1b28f</guid></item></channel></rss>