Repository: qpid-dispatch Updated Branches: refs/heads/master 7c8f31199 -> f77f92cbe
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/f77f92cb/docs/books/user-guide/theory_of_operation.adoc ---------------------------------------------------------------------- diff --git a/docs/books/user-guide/theory_of_operation.adoc b/docs/books/user-guide/theory_of_operation.adoc new file mode 100644 index 0000000..dc50154 --- /dev/null +++ b/docs/books/user-guide/theory_of_operation.adoc @@ -0,0 +1,394 @@ +//// +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License +//// + += Theory of Operation + +This section introduces some key concepts about the router. + +== Overview + +The {RouterName} is an _application layer_ program running as a normal +user program or as a daemon. + +{RouterName} accepts AMQP connections from clients and creates AMQP +connections to brokers or AMQP-based services. {RouterName} classifies +incoming AMQP messages and routes the +messages between message producers and message consumers. + +{RouterName} is meant to be deployed in topologies of multiple routers, +preferably with redundant paths. It uses link-state routing protocols +and algorithms similar to OSPF or IS-IS from the networking world to +calculate the best path from every message source to every message +destination and to recover quickly from failures. {RouterName} relies on +redundant network paths to provide continued connectivity in the face +of system or network failure. + +A messaging client can make a single AMQP connection into a messaging +bus built with routers and, over that connection, exchange messages +with one or more message brokers connected to any router in the +network. At the same time the client can exchange messages directly +with other endpoints without involving a broker at all. + +== Connections + +{RouterName} connects clients, servers, AMQP services, and other +routers through network connections. + +=== Listener + +{RouterName} provides _listeners_ that accept client connections. +A client connecting to a router listener uses the +same methods that it would use to connect to a broker. From the +client's perspective the router connection and link establishment are +identical to broker connection and link establishment. + +Several types of listeners are defined by their role. + +[cols="20,80"] +|=== +| Role | Description +| normal | The connection is used for AMQP clients using normal message delivery. +| inter-router | The connection is assumed to be to another router in the network. Inter-router discovery and routing protocols can only be used over inter-router connections. +| route-container | The connection is a broker or other resource that holds known addresses. The router will use this connection to create links as necessary. The addresses are available for routing only after the remote resource has created a connection. +|=== + +=== Connector + +{RouterName} can also be configured to create outbound connections to +messaging brokers or other AMQP entities using _connectors_. A +connector is defined with the network address of the broker and the +name or names of the resources that are available in that broker. When +a router connects to a broker through a connector it uses the same +methods a normal messaging client would use when connecting to the +broker. + +Several types of connectors are defined by their role. + +[cols="20,80"] +|=== +| Role | Description +| normal | The connection is used for AMQP clients using normal message delivery. On this connector the router will initiate the connection but it will never create any links. Links are to be created by the peer that accepts the connection. +| inter-router | The connection is assumed to be to another router in the network. Inter-router discovery and routing protocols can only be used over inter-router connections. +| route-container | The connection is to a broker or other resource that holds known addresses. The router will use this connection to create links as necessary. The addresses are available for routing only after the router has created a connection to the remote resource. +|=== + +== Addresses + +AMQP addresses are used to control the flow of messages across a +network of routers. Addresses are used in a number of different places +in the AMQP 1.0 protocol. They can be used in a specific message in +the _to_ and _reply-to_ fields of a message's properties. They are also +used during the creation of links in the _address_ field of a _source_ or +a _target_. + +[NOTE] +==== +Addresses in this discussion refer to AMQP protocol addresses and not +to TCP/IP network addresses. TCP/IP network addresses are used by +messaging clients, brokers, and routers to create AMQP connections. +AMQP protocol addresses are the names of source and destination +endpoints for messages within the messaging network. +==== + +Addresses designate various kinds of entities in a messaging network: + +* Endpoint processes that consume data or offer a service +* Topics that match multiple consumers to multiple producers +* Entities within a messaging broker: +** Queues +** Durable Topics +** Exchanges + +The syntax of an AMQP address is opaque as far as the router network +is concerned. A syntactical structure may be used by the administrator +who creates addresses but the router treats them as opaque +strings. + +{RouterName} maintains several classes of address based on how the address is +configured or discovered. + +[cols="25,75"] +|=== +| Address Type | Description +| mobile | The address is a rendezvous point between senders and receivers. The router aggregates and serializes messages from senders and distributes messages to receivers. +| link route | The address defines a private messaging path between a sender and a receiver. The router simply passes messages between the end points. +|=== + +=== Mobile Addresses + +Routers consider addresses to be mobile such that any users of an +address may be directly connected to any router in a network and may +move around the topology. In cases where messages are broadcast to or +balanced across multiple consumers, the address users may be connected +to multiple routers in the network. + +Mobile addresses are rendezvous points for senders and receivers. +Messages arrive at the mobile address and are dispatched to their +destinations according to the routing defined for the mobile address. +The details of these routing patterns are discussed later. + +Mobile addresses may be discovered during normal router operation or +configured through management settings. + +==== Discovered Mobile Addresses + +Mobile addresses are created when a client creates a link to a source +or destination address that is unknown to the router network. + +Suppose a service provider wants to offer _my-service_ that clients +may use. The service provider must open a receiver link with source +address _my-service_. The router creates a mobile address +_my-service_ and propagates the address so that it is known to every +router in the network. + +Later a client wants to use the service and creates a sending link +with target address _my-service_. The router matches the service +provider's receiver having source address _my-service_ to the client's +sender having target address _my-service_ and routes messages between +the two. + +Any number of other clients can create links to the service as +well. The clients do not have to know where in the router network the +service provider is physically located nor are the clients required to +connect to a specific router to use the service. Regardless of how +many clients are using the service the service provider needs only a +single connection and link into the router network. + +Another view of this same scenario is when a client tries to use the +service before service provider has connected to the network. In this +case the router network creates the mobile address _my-service_ as +before. However, since the mobile address has only client sender links +and no receiver links the router stalls the clients and prevents them +from sending any messages. Later, after the service provider connects +and creates the receiver link, the router will issue credits to the +clients and the messages will begin to flow between the clients and +the service. + +The service provider can connect, disconnect, and reconnect from a +different location without having to change any of the clients or +their connections. Imagine having the service running on a +laptop. One day the connection is from corporate headquarters and the +next day the connection is from some remote location. In this case the +service provider's computer will typically have different host IP +addresses for each connection. Using the router network the service +provider connects to the router network and offers the named service +and the clients connect to the router network and consume from the +named service. The router network routes messages between the mobile +addresses effectively masking host IP addresses of the service +provider and the client systems. + +==== Configured Mobile Addresses + +Mobile addresses may be configured using the router _autoLink_ +object. An address created via an _autoLink_ represents a queue, +topic, or other service in an external broker. Logically the +_autoLink_ addresses are treated by the router network as if the +broker had connected to the router and offered the services itself. + +For each configured mobile address the router will create a single +link to the external resource. Messages flow between sender links and +receiver links the same regardless if the mobile address was +discovered or configured. + +Multiple _autoLink_ objects may define the same address on multiple +brokers. In this case the router network creates a sharded resource +split between the brokers. Any client can seamlessly send and receive +messages from either broker. + +Note that the brokers do not need to be clustered or federated to +receive this treatment. The brokers may even be from different vendors +or be different versions of the same broker yet still work together to +provide a larger service platform. + +=== Link Route Addresses + +Link route addresses may be configured using the router _linkRoute_ +object. An link route address represents a queue, topic, or other +service in an external broker similar to addresses configured by +_autoLink_ objects. For link route addresses the router propagates a +separate link attachment to the broker resource for each incoming +client link. The router does not automatically create any links to the +broker resource. + +Using link route addresses the router network does not participate in +aggregated message distribution. The router simply passes message +delivery and settlement between the two end points. + +== Message Routing + +Addresses have semantics associated with them that are assigned when +the address is provisioned or discovered. The semantics of an address +control how routers behave when they see the address being +used. Address semantics include the following considerations: + +* Routing pattern - balanced, closest, multicast +* Routing mechanism - message routed, link routed + +// * TODO: describe these??? +// * Undeliverable action - drop, hold and retry, redirect +// * Reliability - N destinations, etc. + +=== Routing Patterns + +Routing patterns define the paths that a message with a mobile address +can take across a network. These routing patterns can be used for both +direct routing, in which the router distributes messages between +clients without a broker, and indirect routing, in which the router +enables clients to exchange messages through a broker. + +Note that the routing patterns fall into two categories: Anycast +(Balanced and Closest) and Multicast. There is no concept of +"unicast" in which there is only one consumer for an address. + +Anycast distribution delivers each message to one consumer whereas +multicast distribution delivers each message to all consumers. + +Anycast delivery is reliable when the message deliveries are +unsettled. There is a reliability contract that the router network +abides by when delivering unsettled messages to anycast addresses. +For every such delivery sent by a producer, the router network +guarantees that one of the following outcomes will occur: + +* The delivery shall be settled with ACCEPTED or REJECTED disposition + where the disposition is supplied by the consumer. +* The delivery shall be settled with RELEASED disposition, meaning + that the message was not delivered to any consumer. +* The delivery shall be settled with MODIFIED disposition, meaning + that the message may have been delivered to a consumer but should be + considered in-doubt and re-sent. +* The connection to the producer shall be dropped, signifying that all + unsettled deliveries should now be considered in-doubt by the + producer and later re-sent. + +Multicast delivery is not reliable. If a producer sends an unsettled +delivery, the ingress router shall settle the delivery with ACCEPTED +disposition regardless of whether the message was delivered to any +consumers. + +==== Balanced + +An anycast method which allows multiple receivers to use the same +address. In this case, messages (or links) are routed to exactly one +of the receivers and the network attempts to balance the traffic load +across the set of receivers using the same address. This routing +delivers messages to receivers based on how quickly they settle the +deliveries. Faster receivers get more messages. + +==== Closest + +An anycast method in which even if there are more receivers for the +same address, every message is sent along the shortest path to reach +the destination. This means that only one receiver will get the +message. Each message is delivered to the closest receivers in terms +of topology cost. If there are multiple receivers with the same lowest +cost, deliveries will be spread evenly among those receivers. + +==== Multicast + +Having multiple consumers on the same address at the same time, +messages are routed such that each consumer receives one copy of the +message. + + +=== Routing Mechanisms + +The fact that addresses can be used in different ways suggests that +message routing can be accomplished in different ways. Before going +into the specifics of the different routing mechanisms, it would be +good to first define what is meant by the term _routing_: + + In a network built of multiple, interconnected routers 'routing' + determines which connection to use to send a message directly + to its destination or one step closer to its destination. + +Each router serves as the terminus of a collection of incoming and +outgoing links. Some of the links are designated for message routing, +and others are designated for link routing. In both cases, the links +either connect directly to endpoints that produce and consume +messages, or they connect to other routers in the network along +previously established connections. + +==== Message Routed + +Message routing occurs upon delivery of a message and is done based on +the address in the message's _to_ field. + +When a delivery arrives on an incoming message-routing link, the +router extracts the address from the delivered message's _to_ field and +looks the address up in its routing table. The lookup results in zero +or more outgoing links onto which the message shall be resent. + +Message routing can also occur without an address in the +message's _to_ field if the incoming link has a target address. In +fact, if the sender uses a link with a target address, the _to_ field +shall be ignored even if used. + +==== Link Routed + +Link routing occurs when a new link is attached to the router across +one of its AMQP connections. It is done based on the _target.address_ +field of an inbound link and the _source.address_ field of an outbound +link. + +Link routing uses the same routing table that message routing +uses. The difference is that the routing occurs during the link-attach +operation, and link attaches are propagated along the appropriate path +to the destination. What results is a chain of links, connected +end-to-end, from source to destination. It is similar to a virtual +circuit in a telecom system. + +Each router in the chain holds pairs of link termini that are tied +together. The router then simply exchanges all deliveries, delivery +state changes, and link state changes between the two termini. + +The endpoints that use the link chain do not see any difference in +behavior between a link chain and a single point-to-point link. All of +the features available in the link protocol (flow control, +transactional delivery, etc.) are available over a routed link-chain. + +=== Message Settlement + +Messages may be delivered with varying degrees of reliability. + +* At most once +* At least once +* Exactly once + +The reliability is negotiated between the client and server during +link establishment. The router handles all levels of reliability by treating +messages as either _pre-settled_ or _unsettled_. + +[cols="20,80"] +|=== +| Delivery | Handling +| pre-settled | If the arriving delivery is pre-settled (i.e., fire and forget), the incoming delivery shall be settled by the router, and the outgoing deliveries shall also be pre-settled. In other words, the pre-settled nature of the message delivery is propagated across the network to the message's destination. +| unsettled | Unsettled delivery is also propagated across the network. Because unsettled delivery records cannot be discarded, the router tracks the incoming deliveries and keeps the association of the incoming deliveries to the resulting outgoing deliveries. This kept association allows the router to continue to propagate changes in delivery state (settlement and disposition) back and forth along the path which the message traveled. +|=== + +== Security + +{RouterName} uses the SSL protocol and related certificates and SASL +protocol mechanisms to encrypt and authenticate remote peers. Router +listeners act as network servers and router connectors act as network +clients. Both connection types may be configured securely with SSL +and SASL. + +The router `policy` module is an optional authorization mechanism +enforcing user connection restrictions and AMQP resource access +control. http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/f77f92cb/docs/books/user-guide/understand-router-configuration.adoc ---------------------------------------------------------------------- diff --git a/docs/books/user-guide/understand-router-configuration.adoc b/docs/books/user-guide/understand-router-configuration.adoc new file mode 100644 index 0000000..a576f65 --- /dev/null +++ b/docs/books/user-guide/understand-router-configuration.adoc @@ -0,0 +1,206 @@ +//// +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License +//// + +[id='router-configuration'] += Configuration + +Before starting {RouterName}, you should understand where the router's configuration file is stored, how the file is structured, and the methods you can use to modify it. + +== Accessing the Router Configuration File + +The router's configuration is defined in the router configuration file. You can access this file to view and modify that configuration. + +.Procedure + +* Open the following file: `/etc/qpid-dispatch/qdrouterd.conf`. ++ +-- +When {RouterName} is installed, `qdrouterd.conf` is installed in this directory by default. When the router is started, it runs with the settings defined in this file. + +For more information about the router configuration file (including available entities and attributes), see the {qdrouterdManPageLink}. +-- + +== How the Router Configuration File is Structured + +Before you can make changes to a router configuration file, you should understand how the file is structured. + +The configuration file contains sections. A section is a configurable entity, and it contains a set of attribute name-value pairs that define the settings for that entity. The syntax is as follows: + +[options="nowrap"] +---- +sectionName { + attributeName: attributeValue + attributeName: attributeValue + ... +} +---- + +[id='methods-for-changing-router-configuration'] +== Changing a Router's Configuration + +You can use different methods for changing a router's configuration based on whether the router is currently running, and whether you want the change to take effect immediately. + +.Choices +* xref:making-permanent-change-to-router-configuration[Make a permanent change to the router's configuration]. +* xref:changing-configuration-for-running-router[Change the configuration for a running router.] + +[id='making-permanent-change-to-router-configuration'] +=== Making a Permanent Change to the Router's Configuration + +You can make a permanent change to the router's configuration by editing the router's configuration file directly. You must restart the router for the changes to take effect, but the changes will be saved even if the router is stopped. + +.Procedure + +. Do one of the following: ++ +* Edit the default configuration file (`/etc/qpid-dispatch/qdrouterd.conf`). +* Create a new configuration file. + +. Start (or restart) the router. ++ +If you created a new configuration file, you must specify the path using the `--conf` parameter. For example, the following command starts the router with a non-default configuration file: ++ +[options="nowrap"] +---- +$ sudo qdrouterd -d --conf /etc/qpid-dispatch/new-configuration-file.conf +---- + +[id='changing-configuration-for-running-router'] +=== Changing the Configuration for a Running Router + +If the router is running, you can change its configuration on the fly. The changes you make take effect immediately, but are lost if the router is stopped. + +.Procedure + +* Use `qdmanage` to change the configuration. ++ +For more information about using `qdmanage`, see xref:managing-router[Managing {RouterName} Using _qdmanage_]. + +== Default Configuration Settings + +The router's configuration file controls the way in which the router functions. The default configuration file contains the minimum number of settings required for the router to run. As you become more familiar with the router, you can add to or change these settings, or create your own configuration files. + +When you installed {RouterName}, the default configuration file was added at the following path: `/etc/qpid-dispatch/qdrouterd.conf`. It includes some basic configuration settings that define the router's operating mode, how it listens for incoming connections, and routing patterns for the message routing mechanism. + +.Default Configuration File + +[options="nowrap"] +---- +router { + mode: standalone // <1> + id: Router.A // <2> +} + +listener { // <3> + host: 0.0.0.0 // <4> + port: amqp // <5> + authenticatePeer: no // <6> +} + +address { // <7> + prefix: closest + distribution: closest +} + +address { + prefix: multicast + distribution: multicast +} + +address { + prefix: unicast + distribution: closest +} + +address { + prefix: exclusive + distribution: closest +} + +address { + prefix: broadcast + distribution: multicast +} +---- +<1> By default, the router operates in _standalone_ mode. This means that it can only communicate with endpoints that are directly connected to it. It cannot connect to other routers, or participate in a router network. +<2> The unique identifier of the router. This ID is used as the `container-id` (container name) at the AMQP protocol level. It is required, and the router will not start if this attribute is not defined. +<3> The `listener` entity handles incoming connections from client endpoints. +<4> The IP address on which the router will listen for incoming connections. By default, the router is configured to listen on all network interfaces. +<5> The port on which the router will listen for incoming connections. By default, the default AMQP port (5672) is specified with a symbolic service name. +<6> Specifies whether the router should authenticate peers before they can connect to the router. By default, peer authentication is not required. +<7> By default, the router is configured to use the message routing mechanism. Each `address` entity defines how messages that are received with a particular address `prefix` should be distributed. For example, all messages with addresses that start with `closest` will be distributed using the `closest` distribution pattern. + +[NOTE] +==== +If a client requests a message with an address that is not defined in the router's configuration file, the `balanced` distribution pattern will be used automatically. +==== + +== Setting Essential Configuration Properties + +The router's default configuration settings enable the router to run with minimal configuration. However, you may need to change some of these settings for the router to run properly in your environment. + +.Procedure + +. Open the router's configuration file. ++ +If you are changing the router's default configuration file, the file is located at `/etc/qpid-dispatch/qdrouterd.conf`. + +. To define essential router information, change the following attributes as needed in the `router` section: ++ +-- +[options="nowrap",subs="+quotes"] +---- +router { + mode: _STANDALONE/INTERIOR_ + id: _ROUTER_ID_ +} +---- + +`mode`:: Specify one of the following modes: ++ +* `standalone` - Use this mode if the router does not communicate with other routers and is not part of a router network. When operating in this mode, the router only routes messages between directly connected endpoints. +* `interior` - Use this mode if the router is part of a router network and needs to collaborate with other routers. +`id`:: The unique identifier for the router. This ID will also be the container name at the AMQP protocol level. + +For information about additional attributes, see link:{qdrouterdConfManPageUrl}#_router[router] in the `qdrouterd.conf` man page. +-- + +. If necessary for your environment, secure the router. ++ +-- +* xref:setting-up-ssl-for-encryption-and-authentication[Set up SSL/TLS for encryption, authentication, or both] +* xref:setting-up-sasl-for-authentication-and-payload-encryption[Set up SASL for authentication and payload encryption] +-- + +. Connect the router to other routers, clients, and brokers. ++ +-- +* xref:adding-incoming-connections[Add incoming connections] +* xref:adding-outgoing-connections[Add outgoing connections] +-- + +. Set up routing for your environment: ++ +-- +* xref:routing-messages-between-clients[Configure the router to route messages between clients directly] +* xref:routing-messages-through-broker[Configure the router to route messages through a broker queue] +* xref:creating-link-route[Create a link route to define a private messaging path between endpoints] +-- + +. xref:logging[Set up logging]. http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/f77f92cb/docs/books/user-guide/using-console.adoc ---------------------------------------------------------------------- diff --git a/docs/books/user-guide/using-console.adoc b/docs/books/user-guide/using-console.adoc new file mode 100644 index 0000000..4e03eb2 --- /dev/null +++ b/docs/books/user-guide/using-console.adoc @@ -0,0 +1,126 @@ +//// +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License +//// + += Using {ConsoleName} + +[[console-overview]] +== Console Overview + +The console is an HTML based web site that displays information about a qpid dispatch router network. + +The console requires an HTML web server that can serve static html, javascript, style sheets, and images. + +The console only provides limited information about the clients that are attached to the router network and is therfore more appropriate for administrators needing to know the layout and health of the router network. + +[[console-installation]] +== Console Installation + +[discrete] +=== Prerequisites + +The following need to be installed before running a console: + +* One or more dispatch routers. See the documentation for the dispatch +router for help in starting a router network. +* A websockets to tcp proxy. +* A web server. This can be any server capable of serving static +html/js/css/image files. + +[discrete] +=== Procedure + +To install a websockets to tcp proxy: + +---- +sudo dnf install python-websockify +websockify localhost:5673 localhost:5672 +---- + +This will start the proxy listening to ws traffic on port 5673 and +translating it to tcp on port 5672. One of the routers in the network +needs to have a listener configured on port 5672. That listener's role +should be 'normal'. For example: + +---- +listener { + host: 0.0.0.0 + role: normal + port: amqp + saslMechanisms: ANONYMOUS +} +---- + +[[the-console-files]] +=== The Console Files + +The files for the console are located under the console/stand-alone +directory in the source tree +* 'index.html' +* 'plugin/' + +Copy these files to a directory under the the html or webapps directory +of your web server. For example, for apache tomcat the files should be +under webapps/dispatch. Then the console is available as 'http://localhost:8080/dispatch' + +[[console-operation]] +== Console Operation + +[[logging-in-to-a-router-network]] +=== Logging into a Router Network + +image:console_login.png[image] + +Enter the address of the websockets to tcp proxy that is connected to a router in the network. + +The Autostart checkbox, when checked, will automatically log in with the previous host:port the next time you start the console. + +[[overview-page]] +=== Overview Page + +image:console_overview.png[image] + +On the overview page, aggregate information about routers, addresses, and connections is displayed. + +[[topology-page]] +=== Topology Page + +image:console_topology.png[image] + +This page displays the router network in a graphical form showing how the routers are connected and information about the individual routers and links. + +[[list-page]] +=== List Page + +image:console_entity.png[image] + +Displays detailed information about entities such as routers, links, addresses, memory. + +[[charts-page]] +=== Charts Page + +image:console_charts.png[image] + +This page displays graphs of numeric values that are on the list page. + +[[schema-page]] +=== Schema Page + +image:console_schema.png[image] + +This page displays the json schema that is used to manage the router network. http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/f77f92cb/docs/man/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/docs/man/CMakeLists.txt b/docs/man/CMakeLists.txt new file mode 100644 index 0000000..bfc54f8 --- /dev/null +++ b/docs/man/CMakeLists.txt @@ -0,0 +1,125 @@ +## +## Licensed to the Apache Software Foundation (ASF) under one +## or more contributor license agreements. See the NOTICE file +## distributed with this work for additional information +## regarding copyright ownership. The ASF licenses this file +## to you under the Apache License, Version 2.0 (the +## "License"); you may not use this file except in compliance +## with the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, +## software distributed under the License is distributed on an +## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +## KIND, either express or implied. See the License for the +## specific language governing permissions and limitations +## under the License. +## + +# Popular locations +set (src ${CMAKE_CURRENT_SOURCE_DIR}) +set (bin ${CMAKE_CURRENT_BINARY_DIR}) +set (tools ${CMAKE_SOURCE_DIR}/tools) +set (schema ../../python/qpid_dispatch/management/qdrouter.json) +set (py_management ../../python/qpid_dispatch_internal/management) +set (schema_deps ${schema} ${py_management}/schema_doc.py ${py_management}/schema.py) + +# Flags for doc tools, based on cmake options +set (ADOC_FLAGS "--conf-file=${bin}/asciidoc.conf") +set (A2X_FLAGS "--asciidoc-opts=--conf-file=${bin}/asciidoc.conf" -D${bin}) + +if (DOC_VERBOSE) + set (ADOC_FLAGS ${ADOC_FLAGS} -v) + set (A2X_FLAGS ${A2X_FLAGS} -v) +endif () + +if (NOT DOC_XMLLINT) + set (A2X_FLAGS ${A2X_FLAGS} --no-xmllint) +endif () + +# Generate asciidoc fragments from management schema to incorporate in text +macro (schema_gen script output) + add_custom_command ( + OUTPUT ${output} + COMMAND ${RUN} -s ${script} 1> ${output} + DEPENDS ${script} ${schema_deps}) + list (APPEND generated_txt "${output}") +endmacro () + +schema_gen (${src}/qdrouterd.conf.5.py ${bin}/qdrouterd.conf.5.adoc) + +# Generate asciidoc .adoc from --help output for man pages +macro (help2txt program) + get_filename_component (name ${program} NAME) + set (output ${bin}/${name}_help.adoc) + add_custom_command ( + OUTPUT ${output} + COMMAND ${RUN} -s ${src}/help2txt.py ${program} --help 1> ${output} + DEPENDS ${program} ${schema_deps} ${src}/help2txt.py + ) + list (APPEND generated_txt "${output}") +endmacro () + +help2txt (${CMAKE_BINARY_DIR}/router/qdrouterd) +help2txt (${tools}/qdmanage) +help2txt (${tools}/qdstat) + +add_custom_target (doc_gen ALL DEPENDS ${generated_txt}) + +execute_process (COMMAND ${CMAKE_COMMAND} -E copy_directory ${src} ${bin}) + +find_program (ASCIIDOC_EXE asciidoc DOC "Generate HTML documentation") + +if (ASCIIDOC_EXE) + configure_file (${src}/asciidoc.conf.in ${bin}/asciidoc.conf) + + # Generate HTML + file (GLOB_RECURSE adoc_files *.adoc) + foreach (source qdmanage.8 qdrouterd.8 qdstat.8 qdrouterd.conf.5) + get_filename_component (name ${source} NAME) + get_filename_component (dir ${source} PATH) + string(FIND ${name} "." dot) + if (dot GREATER 0) + string (LENGTH ${name} length) + math (EXPR desired_length "${length}-2") + string (SUBSTRING ${name} "0" ${desired_length} name) + endif () + set (output ${bin}/${dir}/${name}.html) + add_custom_command ( + OUTPUT ${output} ${output}.in + # Pretty .html for direct viewing. + COMMAND ${ASCIIDOC_EXE} ${ADOC_FLAGS} -o ${output} ${source}.adoc + # Raw .html.in body for inclusion in Qpid website. + COMMAND ${ASCIIDOC_EXE} ${ADOC_FLAGS} -s -o ${output}.in ${source}.adoc + DEPENDS ${source}.adoc ${generated_txt} ${adoc_files} ${bin}/asciidoc.conf + WORKING_DIRECTORY ${bin} + ) + list (APPEND docs_deps ${output}) + endforeach () + + find_program(A2X_EXE a2x DOC DOC "Generate Unix man pages") + if (A2X_EXE) + # Generate man pages. + foreach (source ${bin}/qdmanage.8 ${bin}/qdrouterd.8 ${bin}/qdstat.8 ${bin}/qdrouterd.conf.5) + get_filename_component (name ${source} NAME) + get_filename_component (dir ${source} PATH) + string(REGEX REPLACE ".*\\.([0-9])$" "\\1" section ${source}) # Man section number + set (output ${bin}/${name}) + add_custom_command ( + OUTPUT ${output} + COMMAND ${A2X_EXE} ${A2X_FLAGS} -f manpage -D ${bin} ${source}.adoc + DEPENDS ${source}.adoc ${generated_txt} + ) + list (APPEND docs_deps ${output}) + install (FILES ${output} DESTINATION ${CMAKE_INSTALL_PREFIX}/${MAN_INSTALL_DIR}/man${section} OPTIONAL) + endforeach () + else () + message (STATUS "a2x not found: not generating man pages or PDF") + endif () +else () + message (STATUS "asciidoc not found: not generating HTML, man pages or PDF") +endif () + +add_custom_target (man DEPENDS ${docs_deps}) +add_dependencies (docs man) http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/f77f92cb/docs/man/asciidoc.conf.in ---------------------------------------------------------------------- diff --git a/docs/man/asciidoc.conf.in b/docs/man/asciidoc.conf.in new file mode 100644 index 0000000..6f1ea02 --- /dev/null +++ b/docs/man/asciidoc.conf.in @@ -0,0 +1,31 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +[attributes] +SYSCONF_INSTALL_DIR=${SYSCONF_INSTALL_DIR} +CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} +QD_DOC_INSTALL_DIR=${QD_DOC_INSTALL_DIR} +QPID_DISPATCH_VERSION=${QPID_DISPATCH_VERSION} + +generated=${CMAKE_CURRENT_BINARY_DIR} +generated_book=${CMAKE_CURRENT_BINARY_DIR}/book +generated_man=${CMAKE_CURRENT_BINARY_DIR} + +[footer-text] +Qpid Dispatch ${QPID_DISPATCH_VERSION} - generated {localdate} {localtime} http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/f77f92cb/docs/man/help2txt.py ---------------------------------------------------------------------- diff --git a/docs/man/help2txt.py b/docs/man/help2txt.py new file mode 100644 index 0000000..24aeb53 --- /dev/null +++ b/docs/man/help2txt.py @@ -0,0 +1,69 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License +# + +""" +Convert --help output of a program into asciidoc text format. +""" +from __future__ import print_function +from __future__ import unicode_literals +from __future__ import division +from __future__ import absolute_import + + +import re, sys +from qpid_dispatch_internal.compat import PY_STRING_TYPE +from qpid_dispatch_internal.compat.subproc import check_output + + +def help2txt(help_out): + VALUE = r"(?:[\w-]+|<[^>]+>)" + DEFAULT = r"(?: +\([^)]+\))?" + OPTION = r"-[\w-]+(?:[ =]%s)?%s" % (VALUE, DEFAULT) # -opt[(=| )value][(default)] + OPTIONS = r"%s(?:, *%s)*" % (OPTION, OPTION) # opt[,opt...] + HELP = r"(?:[ \t]+\w.*$)|(?:(?:\n[ \t]+[^-\s].*$)+)" # same line or following lines indented. + OPT_HELP = r"^\s+(%s)(%s)" % (OPTIONS, HELP) + SUBHEAD = r"^((?: +\w+)*):$" + + # check_output returns binary in py3 + if not isinstance(help_out, PY_STRING_TYPE): + help_out = help_out.decode() + + options = re.search("^Options:$", help_out, re.IGNORECASE | re.MULTILINE) + if (options): help_out = help_out[options.end():] + result = "" + + def heading(text, depth): + return "%s %s\n\n" % ("="*depth, text) + + for item in re.finditer(r"%s|%s" % (OPT_HELP, SUBHEAD), help_out, re.IGNORECASE | re.MULTILINE): + if item.group(3): + result += heading(item.group(3).strip(), 3) + else: + result += "%s\n: %s\n\n" % (item.group(1), re.sub("\s+", " ", item.group(2)).strip()) + return result + +def main(argv): + if len(argv) < 2: raise ValueError("Wrong number of arguments\nUsage %s" + " <program> [args,...]" % argv[0]) + program = argv[1:] + print(help2txt(check_output(program))) + +if __name__ == "__main__": + main(sys.argv) + http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/f77f92cb/docs/man/qdmanage.8.adoc ---------------------------------------------------------------------- diff --git a/docs/man/qdmanage.8.adoc b/docs/man/qdmanage.8.adoc new file mode 100644 index 0000000..9f668b5 --- /dev/null +++ b/docs/man/qdmanage.8.adoc @@ -0,0 +1,139 @@ +//// +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License +//// + +qdmanage(8) +========== +:doctype: manpage + +NAME +---- +qdmanage - management client to control or query qdrouterd(8) + +SYNOPSIS +-------- +*qdmanage* ['OPTIONS'] 'OPERATION' ['ARGUMENTS'] + +DESCRIPTION +----------- +An AMQP management client for use with the Dispatch router daemon +('qdrouterd'). Sends AMQP management operations requests and prints +the response in JSON format. This is a generic AMQP management tool +and can be used with any standard AMQP managed endpoint, not just +with 'qdrouterd'. + +OPTIONS +------- + +include::{generated_man}/qdmanage_help.adoc[] + +OPERATIONS +---------- + +`query` ['ATTR'...]:: + Print attributes for multiple entities. Prints all entities by default, use + --type, --name or --identity options to restrict which entities are printed. + Prints the attributes named in the ATTR list, or all attributes if none are + listed. + +`create` ['ATTR=VALUE'...]:: + Create a new entity with the specified attributes. With the --stdin + option, read attributes from stdin. This can be a JSON map of + attributes to create a single entity, or a JSON list of maps to create + multiple entities. + +`read`:: + Print all of the attributes of a single entity, specified by the --name or + --identity options. + +`update` ['ATTR=VALUE'...]:: + Update the attributes of an existing entity. If an ATTR name is listed with + no =VALUE, that attribute will be deleted from the entity. With the --stdin + option, read attributes from stdin. This can be a JSON map of attributes to + update a single entity, or a JSON list of maps to update multiple entities. + +`delete`:: + Delete an entity specified by the --name or --identity options. + +`get-types` ['TYPE']:: + List entity types with their base types. With no arguments, list all + types. + +`get-operations` ['TYPE']:: + List entity types with their operations. With no arguments, list all + types. + +`get-attributes` ['TYPE']:: + List entity types with their attributes. With no arguments, list all + types. + +`get-annotations` ['TYPE']:: + List entity types with their annotations. With no arguments, list all + types. + +`get-mgmt-nodes`:: + List all other known management nodes connected to this one. + +`get-json-schema` ['INDENT']:: + Get the router schema in JSON format. Optional integer indent for + formatted output. + +`get-log` ['INDENT']:: + Get recent log entries from the router. + +FILES +----- + +{CMAKE_INSTALL_PREFIX}/{QD_DOC_INSTALL_DIR}/qdrouter.json:: + Management schema for 'qdrouterd'. +{CMAKE_INSTALL_PREFIX}/{QD_DOC_INSTALL_DIR}/qdrouter.json.readme.txt:: + Explanation of the management schema. + +EXAMPLES +-------- + +.Show the logging configuration: +-------------------------------------------------------------- +qdmanage query --type=log +-------------------------------------------------------------- + +.Enable debug and higher log messages by default: +-------------------------------------------------------------- +qdmanage update name=log/DEFAULT enable=debug+ +-------------------------------------------------------------- + +.Enable trace log messages only for the MESSAGE module, and direct MESSAGE logs to the file _test.log_: +-------------------------------------------------------------- +qdmanage update name=log/MESSAGE enable=trace output=test.log +-------------------------------------------------------------- + +.Set MESSAGE logging back to the default: +------------------------------------------------ +qdmanage update name=log/MESSAGE enable=default +------------------------------------------------ + +.Disable MESSAGE logging: +--------------------------------------------- +qdmanage update name=log/MESSAGE enable=none +--------------------------------------------- + +SEE ALSO +---------- +'qdrouterd(8)', 'qdstat(8)', 'qdrouterd.conf(5)' + +http://qpid.apache.org/components/dispatch-router http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/f77f92cb/docs/man/qdrouterd.8.adoc ---------------------------------------------------------------------- diff --git a/docs/man/qdrouterd.8.adoc b/docs/man/qdrouterd.8.adoc new file mode 100644 index 0000000..ae2c2a2 --- /dev/null +++ b/docs/man/qdrouterd.8.adoc @@ -0,0 +1,54 @@ +//// +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License +//// + +qdrouterd(8) +=========== +:doctype: manpage + +NAME +---- +qdrouterd - routes AMQP messages. + +SYNOPSIS +-------- +*qdrouterd* ['OPTIONS'] + + +DESCRIPTION +----------- +The Qpid Dispatch router ('qdrouterd') is a network daemon that directs +AMQP 1.0 messages between endpoints, such as messaging clients and +servers. + +OPTIONS +------- + +include::{generated_man}/qdrouterd_help.adoc[] + +FILES +----- + +{SYSCONF_INSTALL_DIR}/qdrouterd.conf:: + Configuration file. + +SEE ALSO +-------- +'qdrouterd.conf(5)', 'qdstat(8)', 'qdmanage(8)' + +http://qpid.apache.org/components/dispatch-router http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/f77f92cb/docs/man/qdrouterd.conf.5.py ---------------------------------------------------------------------- diff --git a/docs/man/qdrouterd.conf.5.py b/docs/man/qdrouterd.conf.5.py new file mode 100644 index 0000000..e2bdd8e --- /dev/null +++ b/docs/man/qdrouterd.conf.5.py @@ -0,0 +1,155 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License +# + +""" +Generate the qdrouterd.conf. man page from the qdrouterd management schema. +""" + +from __future__ import unicode_literals +from __future__ import division +from __future__ import absolute_import +from __future__ import print_function + +import sys +from qpid_dispatch_internal.management.qdrouter import QdSchema +from qpid_dispatch_internal.management.schema_doc import SchemaWriter +from qpid_dispatch_internal.compat import dict_itervalues + +CONNECTOR = 'org.apache.qpid.dispatch.connector' +LISTENER = 'org.apache.qpid.dispatch.listener' + +class ManPageWriter(SchemaWriter): + + def __init__(self): + super(ManPageWriter, self).__init__(sys.stdout, QdSchema()) + + def attribute_type(self, attr, holder): + # Don't show read-only attributes + if not attr.create and not attr.update: + # It is ok to show the console attributes + if not holder.short_name == "console": + return + super(ManPageWriter, self).attribute_type(attr, holder, show_create=False, show_update=False) + + + + def man_page(self): + self.writeln(r""" +qdrouterd.conf(5) +================= +:doctype: manpage + +NAME +---- +qdrouterd.conf - configuration file for the dispatch router. + +SYNOPSIS +-------- +Provides the initial configuration when 'qdrouterd(8)' starts. The configuration +of a running router can be modified using 'qdmanage(8)'. + + +DESCRIPTION +----------- + +The configuration file is made up of sections with this syntax: + +---- +sectionName { + attributeName: attributeValue + attributeName: attributeValue + ... +} +---- + +For example you can define a router using the 'router' section + +---- +router { + mode: standalone + id: Router.A + ... +} +---- + +or define a listener using the 'listener' section + +---- +listener { + host: 0.0.0.0 + port: 20102 + saslMechanisms: ANONYMOUS + ... +} +---- + +or define a connector using the 'connector' section + +---- +connector { + role: inter-router + host: 0.0.0.0 + port: 20003 + saslMechanisms: ANONYMOUS + ... +} +---- + +An 'sslProfile' section with SSL credentials can be included in multiple 'listener' or 'connector' entities. Here's an example, note +how the 'sslProfile' attribute of 'listener' sections references the 'name' +attribute of 'sslProfile' sections. + +---- +sslProfile { + name: my-ssl + caCertFile: ca-certificate-1.pem + certFile: server-certificate-1.pem + privateKeyFile: server-private-key.pem +} + +listener { + sslProfile: my-ssl + host: 0.0.0.0 + port: 20102 + saslMechanisms: ANONYMOUS +} +---- +""") + + with self.section("Configuration Sections"): + + config = self.schema.entity_type("configurationEntity") + for entity_type in dict_itervalues(self.schema.entity_types): + if config in entity_type.all_bases: + with self.section(entity_type.short_name): + if entity_type.description: + self.para(entity_type.description) + self.attribute_types(entity_type) + + self.writeln(""" +SEE ALSO +-------- + +*qdrouterd(8)*, *qdmanage(8)* + +http://qpid.apache.org/components/dispatch-router +""") + +if __name__ == '__main__': + ManPageWriter().man_page() http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/f77f92cb/docs/man/qdstat.8.adoc ---------------------------------------------------------------------- diff --git a/docs/man/qdstat.8.adoc b/docs/man/qdstat.8.adoc new file mode 100644 index 0000000..bd62be4 --- /dev/null +++ b/docs/man/qdstat.8.adoc @@ -0,0 +1,277 @@ +//// +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License +//// + +qdstat(8) +========= +:doctype: manpage + +NAME +---- +qdstat - show status and statistics for a running 'qdrouterd' + +SYNOPSIS +-------- +*qdstat* ['OPTIONS'] + +DESCRIPTION +----------- +An AMQP monitoring tool that shows status information about networks of Dispatch routers. It can display connections, network nodes and links, and router stats such as memory use. + +OPTIONS +------- + +include::{generated_man}/qdstat_help.adoc[] + +OUTPUT COLUMNS +-------------- + +qdstat -c +~~~~~~~~~ +id:: +The connection's unique identifier. + +host:: +The hostname or internet address of the remotely-connected AMQP container. + +container:: +The container name of the remotely-connected AMQP container. + +role:: +The connection's role: + - 'normal' - The normal connection from a client to a router. + - 'inter-router' - The connection between routers to form a network. + - 'route-container' - The connection to or from a broker or other host to receive link routes and waypoints. + +dir:: +The direction in which the connection was established: + - 'in' - The connection was initiated by the remote container. + - 'out' - The connection was initiated by this router. + +security:: +The security or encryption method, if any, used for this connection. + +authentication:: +The authentication method and user ID of the connection's authenticated user. + +qdstat -l +~~~~~~~~~ +type:: +The type of link: + - 'router-control' - An inter-router link that is reserved for control messages exchanged between routers. + - 'inter-router' - An inter-router link that is used for normal message-routed deliveries. + - 'endpoint' - A normal link to an external endpoint container. + +dir:: +The direction that messages flow on the link: + - 'in' - Deliveries flow inbound to the router. + - 'out' - Deliveries flow outbound from the router. + +conn id:: +The unique identifier of the connection over which this link is +attached. + +id:: +The unique identifier of this link. + +peer:: +For link-routed links, the unique identifier of the peer link. In +link routing, an inbound link is paired with an outbound link. + +class:: +The class of the address bound to the link: + - 'local' - The address that is local to this router (temporary). + - 'topo' - A topological address used for router control messages. + - 'router' - A summary router address used to route messages to a remote routerâs local addresses. + - 'mobile' - A mobile address for an attached consumer or producer. + - 'link-in' - The address match for incoming routed links. + - 'link-out' - The address match for outgoing routed links. + +addr:: +The address bound to the link. + +phs:: +The phase of the address bound to the link. + +cap:: +The capacity, in deliveries, of the link. + +undel:: +The number of undelivered messages stored on the link's FIFO. + +unsett:: +The number of unsettled deliveries being tracked by the link. + +del:: +The total number of deliveries that have transited this link. + +presett:: +The number of pre-settled deliveries that transited this link. + +psdrop:: +The number of pre-settled deliveries that were dropped due to congestion. + +acc:: +The number of deliveries on this link that were accepted. + +rej:: +The number of deliveries on this link that were rejected. + +rel:: +The number of deliveries on this link that were released. + +mod:: +The number of deliveries on this link that were modified. + +admin:: +The administrative status of the link: + - 'enabled' - The link is enabled for normal operation. + - 'disabled' - The link is disabled and should be quiescing or stopped (not yet supported). + +oper:: +The operational status of the link: + - 'up' - The link is operational. + - 'down' - The link is not attached. + - 'quiescing' - The link is in the process of quiescing (not yet supported). + - 'idle' - The link has completed quiescing and is idle (not yet supported). + +name:: +The link name (only shown if the -v option is provided). + +qdstat -n +^^^^^^^^^ + +router-id:: +The router's ID. + +next-hop:: +If this router is not a neighbor, this field identifies the next-hop neighbor used to reach this router. + +link:: +The ID of the link to the neighbor router. + +cost:: +The topology cost to this remote router (with -v option only). + +neighbors:: +The list of neighbor routers (the router's link-state). This field is available only if you specify the -v option. + +valid-origins:: +The list of origin routers for which the best path to the listed router passes through this router (available only with the -v option). + +qdstat -a +~~~~~~~~~ + +class:: +The class of the address: + - 'local' - The address that is local to this router. + - 'topo' - The topological address used for router control messages. + - 'router' - A summary router address used to route messages to a remote router's local addresses. + - 'mobile' - A mobile address for an attached consumer or producer. + +addr:: +The address text. + +phs:: +For mobile addresses only, the phase of the address. Direct addresses have only a phase 0. Waypoint addresses have multiple phases, normally 0 and 1. + +distrib:: +One of the following distribution methods used for this address: + - 'multicast' - A copy of each message is delivered once to each consumer for the address. + - 'closest' - Each message is delivered to only one consumer for the address. The closest (lowest cost) consumer will be chosen. If there are multiple lowest-cost consumers, deliveries will be spread across those consumers. + - 'balanced' - Each message is delivered to only one consumer for the address. The consumer with the fewest outstanding (unsettled) deliveries will be chosen. The cost of the route to the consumer is a threshold for delivery (that is, higher cost consumers will only receive deliveries if closer consumers are backed up). + - 'flood' - Used only for router-control traffic. This is multicast without the prevention of duplicate deliveries. + +in-proc:: +The number of in-process consumers for this address. + +local:: +For this router, the number of local consumers for this address. + +remote:: +The number of remote routers that have at least one consumer for this address. + +cntnr:: +The number of locally-attached containers that are destinations for link routes on this address. + +in:: +The number of deliveries for this address that entered the network on this router. + +out:: +The number of deliveries for this address that exited the network on this router. + +thru:: +The number of deliveries for this address that were forwarded to other routers. + +to-proc:: +The number of deliveries for this address that were delivered to an in-process consumer. + +from-proc:: +The number of deliveries for this address that were received from an in-process producer. + +qdstat --linkroutes +~~~~~~~~~~~~~~~~~~~ + +prefix:: +The address prefix of the link route. + +dir:: +The direction of matching links (from this router's perspective). + +distrib:: +The distribution method used for routed links. This value should always be 'linkBalanced', which is the only supported distribution for routed links. + +status:: +The operational status of the link route: + - 'active' - The route is actively routing attaches (it is ready for use). + - 'inactive' - The route is inactive, because no local destination is connected. + +qstat --autolinks +~~~~~~~~~~~~~~~~~ +addr:: +The auto link's address. + +dir:: +The direction that messages flow over the auto link: + - 'in' - Messages flow in from the route-container to the router network. + - 'out' - Messages flow out to the route-container from the router network. + +phs:: +The address phase for this auto link. + +link:: +The ID of the link managed by this auto link. + +status:: +The operational status of this auto link: + - 'inactive' - There is no connected container for this auto link. + - 'attaching' - The link is attaching to the container. + - 'failed' - The link-attach failed. + - 'active' - The link is operational. + - 'quiescing' - The link is quiescing (not yet supported). + - 'idle' - The link is idle (not yet supported). + +lastErr:: +The description of the last attach failure that occurred on this auto link. + +SEE ALSO +-------- + +'qdrouterd(8)', 'qdmanage(8)', 'qdrouterd.conf(5)' + +http://qpid.apache.org/components/dispatch-router http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/f77f92cb/docs/notes/code-conventions.txt ---------------------------------------------------------------------- diff --git a/docs/notes/code-conventions.txt b/docs/notes/code-conventions.txt new file mode 100644 index 0000000..fb0829c --- /dev/null +++ b/docs/notes/code-conventions.txt @@ -0,0 +1,32 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + + +Code conventions +================ + +Python code +----------- + +Python code should be http://www.python.org/dev/peps/pep-0008/[PEP-8] +compliant. In particular: + +* Use four-space indents +* Do not use studlyCaps for function, method, and variable names; +instead use underscore_separated_names --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org