summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJonathan Robie <jonathan@apache.org>2010-04-17 12:03:26 +0000
committerJonathan Robie <jonathan@apache.org>2010-04-17 12:03:26 +0000
commitef97372c04344fe0c0d7234263c25b31c4ed854a (patch)
treedb4133c45c72c4f9ae5612a41559ed703fff6c21 /doc
parent809b4462b72f527961344c76eb0ba24074ee8d49 (diff)
downloadqpid-python-ef97372c04344fe0c0d7234263c25b31c4ed854a.tar.gz
Formatting whitespace.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@935168 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'doc')
-rw-r--r--doc/book/src/High-Level-API.xml99
1 files changed, 53 insertions, 46 deletions
diff --git a/doc/book/src/High-Level-API.xml b/doc/book/src/High-Level-API.xml
index 0997473506..a1607f149d 100644
--- a/doc/book/src/High-Level-API.xml
+++ b/doc/book/src/High-Level-API.xml
@@ -188,10 +188,12 @@ finally:
linkend="QpidJNDI"/>.)</para>
<programlisting><![CDATA[
-java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
+java.naming.factory.initial
+ = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
# connectionfactory.[jndiname] = [ConnectionURL]
-connectionfactory.qpidConnectionfactory = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
+connectionfactory.qpidConnectionfactory
+ = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
# destination.[jndiname] = [address_string]
destination.topicExchange = amq.topic
]]></programlisting>
@@ -208,43 +210,43 @@ import java.util.Properties;
public class Hello {
- public Hello() {
- }
+ public Hello() {
+ }
- public static void main(String[] args) {
- Hello producer = new Hello();
- producer.runTest();
- }
+ public static void main(String[] args) {
+ Hello producer = new Hello();
+ producer.runTest();
+ }
- private void runTest() {
- try {
- Properties properties = new Properties();
- properties.load(this.getClass().getResourceAsStream("hello.properties"));
- Context context = new InitialContext(properties);
+ private void runTest() {
+ try {
+ Properties properties = new Properties();
+ properties.load(this.getClass().getResourceAsStream("hello.properties"));
+ Context context = new InitialContext(properties);
- ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup("qpidConnectionfactory");
- Connection connection = connectionFactory.createConnection();
- connection.start();
+ ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup("qpidConnectionfactory");
+ Connection connection = connectionFactory.createConnection();
+ connection.start();
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Destination destination = (Destination) context.lookup("topicExchange");
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Destination destination = (Destination) context.lookup("topicExchange");
- MessageProducer messageProducer = session.createProducer(destination);
- MessageConsumer messageConsumer = session.createConsumer(destination);
+ MessageProducer messageProducer = session.createProducer(destination);
+ MessageConsumer messageConsumer = session.createConsumer(destination);
- TextMessage message = session.createTextMessage("Hello world!");
- messageProducer.send(message);
+ TextMessage message = session.createTextMessage("Hello world!");
+ messageProducer.send(message);
- message = (TextMessage)messageConsumer.receive();
- System.out.println(message.getText());
+ message = (TextMessage)messageConsumer.receive();
+ System.out.println(message.getText());
- connection.close();
- context.close();
- }
- catch (Exception exp) {
- exp.printStackTrace();
- }
+ connection.close();
+ context.close();
}
+ catch (Exception exp) {
+ exp.printStackTrace();
+ }
+ }
}
]]></programlisting>
@@ -338,6 +340,9 @@ options ::= { <key> : <value>, ... }
being resolved.</para>
</note></para>
+ <para>For many applications, there is no need to use anything more
+ complex than a simple address string.</para>
+
<example>
<title>Simple Address Strings</title>
@@ -661,6 +666,9 @@ $ ./drain -a amqp010-queue -t 30
</screen>
<para>Now let's send some messages. The subject is not used for routing purposes.</para>
+
+ <para><emphasis>Second Window:</emphasis></para>
+
<screen>
$ ./spout -a amqp010-queue/news
$ ./spout -a amqp010-queue
@@ -982,19 +990,16 @@ TODO: Add some reliability option examples
<para>Request-response applications frequently use a reply-to property to tell a server where to send a response. The following C++ code shows how a server extracts the reply-to property and uses it to set the address to respond to a client.</para>
<programlisting lang="c++">
- Message request = receiver.fetch();
- const Address&amp; address = request.getReplyTo(); <lineannotation>Get "reply-to" field from request ...</lineannotation>
- if (address) {
- Sender sender = session.createSender(address); <lineannotation>... and use it as the address to send response</lineannotation>
- std::string s = request.getContent();
- std::transform(s.begin(), s.end(), s.begin(), toupper);
- Message response(s);
- sender.send(response);
- std::cout &lt;&lt; "Processed request: "
- &lt;&lt; request.getContent()
- &lt;&lt; " -> "
- &lt;&lt; response.getContent() &lt;&lt; std::endl;
- session.acknowledge();
+Message request = receiver.fetch();
+const Address&amp; address = request.getReplyTo(); // Get "reply-to" from request ...
+if (address) {
+ Sender sender = session.createSender(address); // ... send response to "reply-to"
+ std::string s = request.getContent();
+ std::transform(s.begin(), s.end(), s.begin(), toupper);
+ Message response(s);
+ sender.send(response);
+ session.acknowledge();
+}
</programlisting>
<para>In the following table, <varname>msg</varname> refers to the
@@ -1070,14 +1075,16 @@ Examples - do client / server, pub-sub here...
# register some connection factories
# connectionfactory.[jndiname] = [ConnectionURL]
-connectionfactory.qpidConnectionfactory = amqp://guest:guest@clientid/test?brokerlist=&#39;tcp://localhost:5672&#39;
+connectionfactory.qpidConnectionfactory
+ = amqp://guest:guest@clientid/test?brokerlist=&#39;tcp://localhost:5672&#39;
# Register an AMQP destination in JNDI
# destination.[jndiName] = [Address]
-destination.directQueue = direct://amq.direct//message_queue?routingkey=&#39;routing_key&#39;
+destination.directQueue
+ = direct://amq.direct//message_queue?routingkey=&#39;routing_key&#39;
</programlisting>
-
+ <para>The following sections describe the JNDI properties that Qpid uses.</para>
<section>