Author: veithen
Date: Thu Jan 1 10:55:37 2009
New Revision: 730587
URL: http://svn.apache.org/viewvc?rev=730587&view=rev
Log:
Some slight improvements to sample 500.
Modified:
synapse/trunk/java/modules/samples/src/main/java/samples/userguide/EventSubscriber.java
synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml
Modified:
synapse/trunk/java/modules/samples/src/main/java/samples/userguide/EventSubscriber.java
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/modules/samples/src/main/java/samples/userguide/EventSubscriber.java?rev=730587&r1=730586&r2=730587&view=diff
==============================================================================
---
synapse/trunk/java/modules/samples/src/main/java/samples/userguide/EventSubscriber.java
(original)
+++
synapse/trunk/java/modules/samples/src/main/java/samples/userguide/EventSubscriber.java
Thu Jan 1 10:55:37 2009
@@ -31,6 +31,8 @@
import org.apache.axis2.AxisFault;
import java.io.File;
+import javax.xml.namespace.QName;
+
public class EventSubscriber {
@@ -117,6 +119,11 @@
System.out.println("Subscribed to topic " + topic);
Thread.sleep(1000);
System.out.println("Response Received: " +
response.toString());
+ String subId =
+ response.getFirstChildWithName(new
QName(nswse.getNamespaceURI(), "SubscriptionManager"))
+ .getFirstChildWithName(new
QName(nswsa.getNamespaceURI(), "ReferenceParameters"))
+ .getFirstChildWithName(new
QName(nswse.getNamespaceURI(), "Identifier")).getText();
+ System.out.println("Subscription identifier: " + subId);
} catch (AxisFault e) {
System.out.println("Fault Received : "+e.toString());
System.out.println("Fault Code :
"+e.getFaultCode().toString());
Modified: synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml?rev=730587&r1=730586&r2=730587&view=diff
==============================================================================
--- synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml (original)
+++ synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml Thu Jan 1 10:55:37
2009
@@ -4001,9 +4001,12 @@
This will create a new subscription with the SimpleStockQuoteService
deployed on the sample
Axis2 server acting as the sink: whenever a new event is published,
SimpleStockQuoteService
will receive a message with that event.
+ You should see a message like this:
</p>
+<pre>[java] Subscription identifier:
urn:uuid:6989F66706E73C69F5259116575749162017010321</pre>
<p>
- Next, invoke the client (Sender) as follows:
+ You will need this identifier to modify the subscription in the next
steps below.
+ Now, invoke the client (Sender) as follows:
</p>
<pre xml:space="preserve">ant eventsender</pre>
<p>
@@ -4018,17 +4021,17 @@
</p>
<pre>Accepted order for : 1000 stocks of GOOG at $ 10.1</pre>
<p>
- Invoke the client (Un-Subscribe) as follows.
+ To get the current status of the subscription, invoke the client as
follows:
</p>
-<pre xml:space="preserve">ant eventsubscriber -Dmode=unsubscribe
-Didentifier=urn:uuid:6DFDF649A67416BFCC1228112473802909001-111373032</pre>
- <p>
- Invoke the client (Re-New) as follows.
- </p>
-<pre xml:space="preserve">ant eventsubscriber -Dmode=renew
-Didentifier=urn:uuid:6DFDF649A67416BFCC1228112473802909001-111373032
-Dexpires=2009-12-31T21:07:00.000-08:00</pre>
+<pre xml:space="preserve">ant eventsubscriber -Dmode=getstatus
-Didentifier=<i><identifier></i></pre>
+ <p>
+ To renew the subscription, invoke the client as follows:
+ </p>
+<pre xml:space="preserve">ant eventsubscriber -Dmode=renew
-Didentifier=<i><identifier></i>
-Dexpires=2009-12-31T21:07:00.000-08:00</pre>
<p>
- Invoke the client (GetStatus) as follows.
+ Finally, in order to unsubscribe, use the following command:
</p>
-<pre xml:space="preserve">ant eventsubscriber -Dmode=getstatus
-Didentifier=urn:uuid:6DFDF649A67416BFCC1228112473802909001-111373032</pre>
+<pre xml:space="preserve">ant eventsubscriber -Dmode=unsubscribe
-Didentifier=<i><identifier></i></pre>
</div>
<h2>
<a name="Sample501" id="Sample501">Sample 501: EventSource with static
subscriptions</a>