Status of This Document
This document does not track any current development activity. It is the specification of the management framework implemented in the M3 release of the C++ broker and will be left here for user and developer reference.
Development continues on the Qpid Management Framework (QMF) for M4. If you are using M3, this is the document you need. If you are using the SVN trunk, please refer to Qpid Management Framework for up-to-date information.
Introduction
This document describes the management features that are used in the QPID C++ broker as of the M3 milestone. These features do not appear in earlier milestones nor are they implemented in the Java broker.
...
The extensibility requirement introduces complexity to the management protocol that is unnecessary and undesirable for the user/developer that wishes only to manage QPID message brokers. For this reason, the protocol is partitioned into two parts: The basic protocol, which contains only the capability to manage a single broker; and the extended protocol, which provides the hooks for managing an extended set of components. A management console can be implemented using only the basic protocol if the extended capabilities are not needed.
Architectural Framework
There are two primary interfaces defined in the management architecture:Architectural Framework
The Management
...
Exchange
The management exchange (called "qpid.management" currently) is a special type of exchange used for remote management access to the Qpid broker. The management exchange is an extension of the standard "Topic" exchange. It behaves like a topic exchange with the following exceptions:
- When a queue is successfully bound to the exchange, a method is invoked on the broker's management agent to notify it of the presence of a new remote managment client.
- When messages arrive at the exchange for routing, the exchange examines the message's routing key and if the key represents a management command or method, it routes it directly to the management agent rather than routing it to queues using the topic algorithm.
The management exchange is used by the management agent to distribute unsolicited management data. Such data is classified by the routing key allowing management clients to register for only the data they need.
Routing Key Structure
As noted above, the structure of the binding and routing keys used on the management exchange is important to the function of the management architecture. The routing key of a management message determines:
- The type of message (i.e. operation request or unsolicited update).
- The class of the object that the message pertains to.
- The specific operation or update type.
- The namespace in which the class belongs. This allows for plug-in expansion of the management schema for manageable objects that are outside of the broker itself.
Placing this information in the routing key provides the ability to enforce access control at class, operation, and method granularity. It also separates the command structure from the content of the management message (i.e. element values) allowing the content to be encrypted and signed end-to-end while still allowing access control at the message-transport level. This means that special access control code need not be written for the management agent.
There are two general types of routing/binding key:
- Command messages use the key:
agent.<bank#>
orbroker
- Unsolicited keys have the structure:
mgmt.<agent>.<type>.<package>.<class>.<severity>
where<agent>
is the uuid of the originating management agent,<type>
is one of "schema", "prop", "stat", or "event",<package>
is the namespace in which the <class> name is valid, and<class>
is the name of the class as defined in the schema.<severity>
is relevant for events only. It is one of "critical", "error", "warning", or "info".
In both cases, the content of the message (i.e. method arguments, element values, etc.) is carried in the body segment of the message.
The <package>
namespace allows this management framework to be extended with the addition of other software packages.
The Protocol
Protocol Header
The body segments of management messages are composed of sequences of binary-encoded data fields, in a manner consistent with the 0-10 version of the AMQP specification.
All management messages begin with a message header:
No Format |
---|
No Format |
+---------+ +---------+ +---------+ | | | | | | | CLI/GUI | | Console |<======>| CLI/GUI | | | | Server | | | +---------+ octet |0 1 | 2 +---------+ 3 ^ 4 +---------+ 5 6 | 7 ^ | | v v + +---------+---------+---------+---------+---------+---------+---------+---------+ | 'A' | 'M' | '1' | op-code | | sequence | Managed QPID Infrastructure | | | ++---------+---------+---------+---------+ ^ | v +---------+-----+ | |-+ | Management | |-+ | Extensions | | | | | | | +----+---------+-----+ | | +------------+ | +------------+ |
Both management interfaces are based on the AMQP protocol and its type system.
The Management Exchange
The management exchange (called "qpid.management" currently) is a special type of exchange used for remote management access to the Qpid broker. The management exchange is an extension of the standard "Topic" exchange. It behaves like a topic exchange with the following exceptions:
- When a queue is successfully bound to the exchange, a method is invoked on the broker's management agent to notify it of the presence of a new remote managment client.
- When messages arrive at the exchange for routing, the exchange examines the message's routing key and if the key represents a management command or method, it routes it directly to the management agent rather than routing it to queues using the topic algorithm.
The management exchange is used by the management agent to distribute unsolicited management data. Such data is classified by the routing key allowing management clients to register for only the data they need.
Routing Key Structure
As noted above, the structure of the binding and routing keys used on the management exchange is important to the function of the management architecture. The routing key of a management message determines:
- The type of message (i.e. operation request or unsolicited update).
- The class of the object that the message pertains to.
- The specific operation or update type.
- The namespace in which the class belongs. This allows for plug-in expansion of the management schema for manageable objects that are outside of the broker itself.
Placing this information in the routing key provides the ability to enforce access control at class, operation, and method granularity. It also separates the command structure from the content of the management message (i.e. element values) allowing the content to be encrypted and signed end-to-end while still allowing access control at the message-transport level. This means that special access control code need not be written for the management agent.
There are two general types of routing/binding key:
- Command keys have the structure:
agent.method.<package>.<class>.<method>
where<package>
is the namespace in which the <class> name is valid,<class>
is the name of the class as defined in the schema, and<method>
is one of "get", "set", or a schema-defined class-specific method name.
- Unsolicited keys have the structure:
mgmt.<agent>.<type>.<package>.<class>.<severity>
where<agent>
is the uuid of the originating management agent,<type>
is one of "schema", "prop", "stat", or "event",<package>
is the namespace in which the <class> name is valid, and<class>
is the name of the class as defined in the schema.<severity>
is relevant for events only. It is one of "critical", "error", "warning", or "info".
In both cases, the content of the message (i.e. method arguments, element values, etc.) is carried in the body segment of the message.
The <package>
namespace allows this management framework to be extended with the addition of other software packages.
The Protocol
Protocol Header
The body segments of management messages are composed of sequences of binary-encoded data fields, in a manner consistent with the 0-10 version of the AMQP specification.
All management messages begin with a message header:
The first three octets contain the protocol magic number "AM1" which is used to identify the type and version of the message.
The opcode field identifies the operation represented by the message
Protocol Exchange Patterns
The following patterns are followed in the design of the protocol:
- Request-Response
- Query-Indication
- Unsolicited Indication
The Request-Response Pattern
In the request-response pattern, a requestor sends a request message to one of its peers. The peer then does one of two things: If the request can be successfully processed, a single response message is sent back to the requestor. This response contains the requested results and serves as the positive acknowledgement that the request was successfully completed.
If the request cannot be successfully completed, the peer sends a command complete message back to the requestor with an error code and error text describing what went wrong.
The sequence number in the response or command complete message is the same as the sequence number in the request.
No Format |
---|
Requestor Peer
| |
| --- Request (seq) ------------------------------------------> |
| |
No Format |
octet 0 | 1 2 3 4 5 6 7 +| <-------------+---------+---------+---------+- Response (seq) --------+---------+---------+---------+ | | 'A' | 'M' | '1' | op-code | sequence | +---------+---------+---------+---------+---------+---------+---------+---------+ |
The first three octets contain the protocol magic number "AM1" which is used to identify the type and version of the message.
The opcode field identifies the operation represented by the message
Protocol Exchange Patterns
The following patterns are followed in the design of the protocol:
- Request-Response
- Query-Indication
- Unsolicited Indication
The Request-Response Pattern
In the request-response pattern, a requestor sends a request message to one of its peers. The peer then does one of two things: If the request can be successfully processed, a single response message is sent back to the requestor. This response contains the requested results and serves as the positive acknowledgement that the request was successfully completed.
If the request cannot be successfully completed, the peer sends a command complete message back to the requestor with an error code and error text describing what went wrong.
The sequence number in the response or command complete message is the same as the sequence number in the request.
|
|
No Format |
---|
Requestor Peer
| |
| --- Request (seq) ------------------------------------------> |
| |
No Format |
Requestor | Peer | <-------------------------- Command Complete (seq, error) --- | | | | --- Request (seq) --- |
The Query-Indication Pattern
The query-indication pattern is used when there may be zero or more answers to a question. In this case, the requestor sends a query message to its peer. The peer processes the query, sending as many indication messages as needed back to the requestor (zero or more). Once the last indication has been sent, the peer then sends a command complete message with a success code indicating that the query is complete.
If there is an error in the query, the peer may reply with a command complete message containg an error code. In this case, no indication messages may be sent.
All indication and command complete messages shall have the same sequence number that appeared in the query message.
No Format |
---|
Requestor---------------------------------------> | | | | <----------------------------------------- Response (seq) --- |Peer | | |
No Format |
Requestor | --- Query Peer(seq) --------------------------------------------> | | | | <--- Request (seq) ------------------------------------ Indication (seq) ------> | | <--------------------------------------- Indication (seq) --- | | <--------------------------------------- Indication (seq) --- | | <--------------------------------------- CommandIndication Complete (seq, error) --- | | <--------------------------------------- Indication (seq) --- | | | |
The Query-Indication Pattern
The query-indication pattern is used when there may be zero or more answers to a question. In this case, the requestor sends a query message to its peer. The peer processes the query, sending as many indication messages as needed back to the requestor (zero or more). Once the last indication has been sent, the peer then sends a command complete message with a success code indicating that the query is complete.
If there is an error in the query, the peer may reply with a command complete message containg an error code. In this case, no indication messages may be sent.
All indication and command complete messages shall have the same sequence number that appeared in the query message.
No Format |
---|
Requestor | | <------------------------ Command Complete (seq, success) --- | | Peer | |
No Format |
---|
Requestor |Peer | --- Query (seq) ----- | | --- Query (seq) --------------------------------------------> | | | | <--------------------------------------- Indication Command Complete (seq, error) --- | | <--------------------------------------- Indication (seq) --- | | <--------------------------------------- Indication (seq) --- | | <--------------------------------------- Indication (seq) --- | | <--------------------------------------- Indication (seq) --- | |
The Unsolicited-Indication Pattern
The unsolicited-indication pattern is used when one peer needs to send unsolicited information to another peer, or to broadcast information to multiple peers via a topic exchange. In this case, indication messages are sent with the sequence number field set to zero.
No Format |
---|
Peer | Peer | | <------------------------ Command Complete (seq, success) --- | | | | <----------------------------------- Indication (seq = 0) | |
No Format |
--- | Requestor | <----------------------------------- Indication (seq = 0) --- | | <----------------------------------- Indication (seq = 0) --- | | <----------------------------------- Indication (seq = 0) Peer--- | | | | --- Query (seq) |
Object Identifiers
Manageable objects are tagged with a unique 64-bit object identifier. The object identifier space is owned and managed by the management broker. Objects managed by a single management broker shall have unique object identifiers. Objects managed by separate management brokers may have the same object identifier.
If a management console is designed to manage multiple management brokers, it must use the broker identifier as well as the object identifier to ensure global uniqueness.
No Format |
---|
--------------------------------------------> | | 62 48 47 24 23 |0 | <+-+-------------+----------------- Command Complete (seq, error) --- | ------+-----------------------+ |0| sequence | bank | object | +-+-------------+-----------------------+-----------------------+ bit 63 | |
The Unsolicited-Indication Pattern
The unsolicited-indication pattern is used when one peer needs to send unsolicited information to another peer, or to broadcast information to multiple peers via a topic exchange. In this case, indication messages are sent with the sequence number field set to zero.
No Format |
---|
Peer - reserved, must be zero bits 63 .. 48 - broker boot sequence (32K) bits 47 .. 24 - bank (16M) bits 23 .. 0 - Peer | object (16M) |
- For persistent IDs, boot-sequence is zero
- For non-persistent IDs, boot sequence is a constant number which increments each time the management broker is restarted.
- Bank number:
- 0 - reserved
- 1 - broker-persistent objects
- 2..4 - store-persistent objects
- > 4 - transient objects
Establishing Communication Between Client and Agent
Communication is established between the management client and management agent using normal AMQP procedures. The client creates a connection to the broker and then establishes a session with its corresponding channel.
Two private queues are then declared (only one if method invocation is not needed). A management queue is declared and bound to the qpid.management exchange. If the binding key is "mgmt.#", all management-related messages sent to the exchange will be received by this client. A more specific binding key will result in a more restricted set of messages being received (see the section on Routing Key Structure below).
If methods are going to be invoked on managed objects, a second private queue must be declared so the client can receive method replies. This queue is bound to the amq.direct exchange using a routing key equal to the name of the queue.
When a client successfully binds to the qpid.management exchange, the management agent schedules a schema broadcast to be sent to the exchange. The agent will publish, via the exchange, a description of the schema for all manageable objects in its control.
No Format |
---|
Client | | <----------------------------------- Indication (seq = 0) --- | | <----------------------------------- Indication (seq = 0) --- | | <----------------------------------- Indication (seq = 0) --- | | <----------------------------------- Indication (seq = 0) --- |Broker | | |
Object Identifiers
Manageable objects are tagged with a unique 64-bit object identifier. The object identifier space is owned and managed by the management broker. Objects managed by a single management broker shall have unique object identifiers. Objects managed by separate management brokers may have the same object identifier.
If a management console is designed to manage multiple management brokers, it must use the broker identifier as well as the object identifier to ensure global uniqueness.
No Format |
---|
| --- AMQP Connection and Session Setup ----------------------> | | 62 48 47 24 23 0| | +-+----- Queue.declare (private data queue) --------+-------------> | | ----------+-----------------------+ Bind queue to exchange 'qpid.management' key 'mgmt.#' --> | |0| sequence | bank | object | +| -+-- Queue.declare (private method-reply queue) ----------+------------> | | --- Bind queue to exchange 'amq.direct' -----------+-----------------------+ > | | bit 63 - reserved, must be zero bits 63 .. 48 - broker boot sequence (32K) bits 47 .. 24 - bank (16M) bits 23 .. 0 - object (16M) |
- For persistent IDs, boot-sequence is zero
- For non-persistent IDs, boot sequence is a constant number which increments each time the management broker is restarted.
- Bank number:
- 0 - reserved
- 1 - broker-persistent objects
- 2..4 - store-persistent objects
- > 4 - transient objects
Establishing Communication Between Client and Agent
Communication is established between the management client and management agent using normal AMQP procedures. The client creates a connection to the broker and then establishes a session with its corresponding channel.
Two private queues are then declared (only one if method invocation is not needed). A management queue is declared and bound to the qpid.management exchange. If the binding key is "mgmt.#", all management-related messages sent to the exchange will be received by this client. A more specific binding key will result in a more restricted set of messages being received (see the section on Routing Key Structure below).
If methods are going to be invoked on managed objects, a second private queue must be declared so the client can receive method replies. This queue is bound to the amq.direct exchange using a routing key equal to the name of the queue.
When a client successfully binds to the qpid.management exchange, the management agent schedules a schema broadcast to be sent to the exchange. The agent will publish, via the exchange, a description of the schema for all manageable objects in its control.
No Format |
---|
Client| | --- Broker Request -----------------------------------------> | | <---------------------------------------- Broker Response --- | | | | Broker | | | | | --- AMQP Connection and Session Setup ----------------------> | | | | | --- Queue.declare (private data queue) ---------------------> | | --- Bind queue to | <------- Management schema via exchange 'qpid.management' key 'mgmt.#' ---> | | | |
Broadcast of Configuration and Instrumentation Updates
The management agent will periodically publish updates to the configuration and instrumentation of management objects under its control. Under normal circumstances, these updates are published only if they have changed since the last time they were published. Configuration updates are only published if configuration has changed and instrumentation updates are only published if instrumentation has changed. The exception to this rule is that after a management client binds to the qpid.management exchange, all configuration and instrumentation records are published as though they had changed whether or not they actually did.
No Format |
---|
Client | --- Queue.declare (private method-reply queue) -------------> | | --- Bind queue to exchange 'amq.direct' --------------------> | Broker | | | <--- Broker Request -----------------------------------------> Object properties via 'mgmt.*.prop.#' --- | | | <---------------------------------------- Broker Response Object statistics via 'mgmt.*.stat.#' --- | | | | | | | | Publish Interval | | | | <------- Management schema via exchange 'qpid.management' --- | | | | |
Broadcast of Configuration and Instrumentation Updates
The management agent will periodically publish updates to the configuration and instrumentation of management objects under its control. Under normal circumstances, these updates are published only if they have changed since the last time they were published. Configuration updates are only published if configuration has changed and instrumentation updates are only published if instrumentation has changed. The exception to this rule is that after a management client binds to the qpid.management exchange, all configuration and instrumentation records are published as though they had changed whether or not they actually did.
No Format |
---|
Client V | <------------------ Object properties via 'mgmt.*.prop.#' --- | | <------------------ Object statistics via 'mgmt.*.stat.#' --- | | Broker | | |
Invoking a Method on a Managed Object
When the management client wishes to invoke a method on a managed object, it sends a method request message to the qpid.management exchange. The routing key contains the object class and method name (refer to Routing Key Structure below). The method request must have a header entry (reply-to) that contains the name of the method-reply queue so that the method response can be properly routed back to the requestor.
The method request contains a sequence number that is copied to the method reply. This number is opaque to the management agent and may be used by the management client to correlate the reply to the request. The asynchronous nature of requests and replies allows any number of methods to be in-flight at a time. Note that there is no guarantee that methods will be replied to in the order in which they were requested.
No Format |
---|
Client | | <------------------ Object properties via 'mgmt.*.prop.#' --- | | | <------------------ Object statistics via 'mgmt.*.stat.#' --- | | | Broker | | | | | | --- Method Request (to exchange 'qpid.management') | | Publish Interval---------> | | | | | | | | <--------------- Method Reply (via exchange 'amq.direct') --- | | | V | <------------------ Object properties via 'mgmt.*.prop.#' --- | | <------------------ Object statistics via 'mgmt.*.stat.#' --- | | | |
Invoking a Method on a Managed Object
When the management client wishes to invoke a method on a managed object, it sends a method request message to the qpid.management exchange. The routing key contains the object class and method name (refer to Routing Key Structure below). The method request must have a header entry (reply-to) that contains the name of the method-reply queue so that the method response can be properly routed back to the requestor.
The method request contains a sequence number that is copied to the method reply. This number is opaque to the management agent and may be used by the management client to correlate the reply to the request. The asynchronous nature of requests and replies allows any number of methods to be in-flight at a time. Note that there is no guarantee that methods will be replied to in the order in which they were requested.
|
|
Messages for the Basic Scenario
The principals in a management exchange are the management client and the management agent. The management agent is integrated into the QPID broker and the management client is a remote entity. A management agent may be managed by zero or more management clients at any given time. Additionally, a management client may manage multiple management agents at the same time.
For authentication and access control, management relies on the mechanisms supplied by the AMQP protocol.
Basic Opcodes
opcode | message | description |
'B' | Broker Request | This message contains a broker request, sent from the management console to the broker to initiate a management session. |
'b' | Broker Response | This message contains a broker response, sent from the broker in response to a broker request message. |
'z' | Command Completion | This message is sent to indicate the completion of a request. |
'Q' | Class Query | Class query messages are used by a management console to request a list of schema classes that are known by the management broker. |
'q' | Class Indication | Sent by the management broker, a class indication notifies the peer of the existence of a schema class. |
'S' | Schema Request | Schema request messages are used to request the full schema details for a class. |
's' | Schema Response | Schema response message contain a full description of the schema for a class. |
'h' | Heartbeat Indication | This message is published once per publish-interval. It can be used by a client to positively determine which objects did not change during the interval (since updates are not published for objects with no changes). |
'c', 'i', 'g' | Content Indication | This message contains a content record. Content records contain the values of all properties or statistics in an object. Such records are broadcast on a periodic interval if 1) a change has been made in the value of one of the elements, or 2) if a new management client has bound a queue to the management exchange. |
'G' | Get Query | Sent by a management console, a get query requests that the management broker provide content indications for all objects that match the query criteria. |
'M' | Method Request | This message contains a method request. |
'm' | Method Response | This message contains a method result. |
Broker Request Message
When a management client first establishes contact with the broker, it sends a Hello message to initiate the exchange.
No Format |
---|
+-----+-----+-----+-----+-----------------------+ |
No Format |
Client Broker | 'A' | 'M' | '1' | 'B' | 0 | | | --- Method Request (to exchange 'qpid.management') +-----+-----+-----+-----+-----------------------> |+ |
The Broker Request message has no payload.
Broker Response Message
When the broker receives a Broker Request message, it responds with a Broker Response message. This message contains an identifier unique to the broker.
No Format |
---|
|+-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 'b' | 0 | +-----+-----+-----+-----+-----------------------+----------------------------+ | | |brokerId (uuid) | | <+------------------------------------------------------------------------- Method Reply (via exchange 'amq.direct') --- |+ |
Command Completion Message
No Format |
---|
| +-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 'z' | seq | +-----+-----+-----+-----+-----------------------+ | Completion Code | |
Messages for the Basic Scenario
The principals in a management exchange are the management client and the management agent. The management agent is integrated into the QPID broker and the management client is a remote entity. A management agent may be managed by zero or more management clients at any given time. Additionally, a management client may manage multiple management agents at the same time.
For authentication and access control, management relies on the mechanisms supplied by the AMQP protocol.
Basic Opcodes
opcode | message | description |
'B' | Broker Request | This message contains a broker request, sent from the management console to the broker to initiate a management session. |
'b' | Broker Response | This message contains a broker response, sent from the broker in response to a broker request message. |
'z' | Command Completion | This message is sent to indicate the completion of a request. |
'Q' | Class Query | Class query messages are used by a management console to request a list of schema classes that are known by the management broker. |
'q' | Class Indication | Sent by the management broker, a class indication notifies the peer of the existence of a schema class. |
'S' | Schema Request | Schema request messages are used to request the full schema details for a class. |
's' | Schema Response | Schema response message contain a full description of the schema for a class. |
'h' | Heartbeat Indication | This message is published once per publish-interval. It can be used by a client to positively determine which objects did not change during the interval (since updates are not published for objects with no changes). |
'c', 'i', 'g' | Content Indication | This message contains a content record. Content records contain the values of all properties or statistics in an object. Such records are broadcast on a periodic interval if 1) a change has been made in the value of one of the elements, or 2) if a new management client has bound a queue to the management exchange. |
'G' | Get Query | Sent by a management console, a get query requests that the management broker provide content indications for all objects that match the query criteria. |
'M' | Method Request | This message contains a method request. |
'm' | Method Response | This message contains a method result. |
Broker Request Message
When a management client first establishes contact with the broker, it sends a Hello message to initiate the exchange.
|
+-----------------------+-----------------------------------------+
| Completion Text |
+-----------------------------------------------------------------+
|
Class Query
No Format |
---|
+-----+-----+-----+-----+-----------------------+
| 'A' | 'M' | '1' | 'Q' | seq |
+-----+-----+-----+-----+-----------------------+----------+
| package name (str8) |
+----------------------------------------------------------+
|
Class Indication
No Format |
---|
+-----+-----+-----+-----+-----------------------+
| 'A' | 'M' | '1' | 'q' | seq | |
No Format |
+-----+-----+-----+-----+-----------------------+----------+ | 'A' |package 'M' | '1' | 'B' |name (str8) 0 | | +-----+-----+-----+-----+-----------------------+ |
The Broker Request message has no payload.
Broker Response Message
When the broker receives a Broker Request message, it responds with a Broker Response message. This message contains an identifier unique to the broker.
No Format |
---|
+-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 'b' | class name (str8) 0 | +-----+-----+-----+-----+-----------------------+----------------------------+ | schema brokerIdhash (uuidbin128) | +----------------------------------------------------------------------------+ |
...
Schema Request
No Format |
---|
+-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 'zS' | seq | +-----+-----+-----+-----+-----------------------+----------+ | Completion Code packageName (str8) | +-----------------------+-----------------------------------------+ | Completion Text className (str8) | | +----------------------------------------------------------+ +-| schema-hash (bin128) | +----------------------------------------------------------------+ |
...
Schema Response
No Format |
---|
+-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 'Qs' | seq | +-----+-----+-----+-----+-----------------------+----------+ | package name (short string) packageName (str8) | | +----------------------------------------------------------+ |
Class Indication
No Format |
---|
| +-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 'q' |className (str8) seq | +-------+--------+-----+-----+-----------------------+----------+ | package name (short string) schema-hash (bin128) | +-----------+-----------+-----------+-----------+--------------+ | propCnt class name (short| string)statCnt | methodCnt | eventCnt | +-----------+-----------+-----------+-----------+----------------------------+ | propCnt schema hash (bin128)property records | +----------------------------------------------------------+ |
Schema Request
No Format |
---|
+-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 'S' | statCnt statistic records seq | +-----+ | +---------------------------------+-----+-----+-----------------------+----------+ | methodCnt method records packageName (short string) | +----------------------------------------------------------------------------+ | eventCnt event records className (short string) | +----------------------------------------------------------+ | schema-hash (bin128) | +------------------------------------------------------------------+ |
Schema Response
+
|
Each property record is an AMQP map with the following fields. Optional fields may optionally be omitted from the map.
field name | optional | description |
name | no | Name of the property |
type | no | Type code for the property |
access | no | Access code for the property |
index | no | 1 = index element, 0 = not an index element |
optional | no | 1 = optional element (may be not present), 0 = mandatory (always present) |
unit | yes | Units for numeric values (i.e. seconds, bytes, etc.) |
min | yes | Minimum value for numerics |
max | yes | Maximum value for numerics |
maxlen | yes | Maximum length for strings |
desc | yes | Description of the property |
Each statistic record is an AMQP map with the following fields:
field name | optional | description |
name | no | Name of the statistic |
type | no | Type code for the statistic |
unit | yes | Units for numeric values (i.e. seconds, bytes, etc.) |
desc | yes | Description of the statistic |
method and event records contain a main map that describes the method or header followed by zero or more maps describing arguments. The main map contains the following fields:
field name | optional | description |
name | no | Name of the method or event |
argCount | no | Number of argument records to follow |
desc | yes | Description of the method or event |
Argument maps contain the following fields:
field name | method | event | optional | description |
name | yes | yes | no | Argument name |
type | yes | yes | no | Type code for the argument |
dir | yes | no | yes | Direction code for method arguments |
unit | yes | yes | yes | Units for numeric values (i.e. seconds, bytes, etc.) |
min | yes | no | yes | Minimum value for numerics |
max | yes | no | yes | Maximum value for numerics |
maxlen | yes | no | yes | Maximum length for strings |
desc | yes | yes | yes | Description of the argument |
default | yes | no | yes | Default value for the argument |
type codes are numerics with the following values:
value | type |
1 | uint8 |
2 | uint16 |
3 | uint32 |
4 | uint64 |
6 | str8 |
7 | str16 |
8 | absTime(uint64) |
9 | deltaTime(uint64) |
10 | objectReference(uint64) |
11 | boolean(uint8) |
12 | float |
13 | double |
14 | uuid |
15 | map |
16 | int8 |
17 | int16 |
18 | int32 |
19 | int64 |
access codes are numerics with the following values:
value | access |
1 | Read-Create access |
2 | Read-Write access |
3 | Read-Only access |
direction codes are numerics with the following values:
value | direction |
1 | Input (from client to broker) |
2 | Output (from broker to client) |
3 | IO (bidirectional) |
Heartbeat Indication
No Format |
---|
+-----+-----+-----+-----+ |
No Format |
+-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 's' | seq | +-----+-----+-----+-----+-----------------------+----------+ | packageName (short string) | +----------------------------------------------------------+ | className (short string) | +----------------------------------------------------------+ | schema-hash (bin128) | +-----------+-----------+-----------+-----------+----------+ | propCnt | statCnt | methodCnt | eventCnt | +-----------+-----------+-----------+-----------+----------------------------+ | propCnt property records | +----------------------------------------------------------------------------+ | statCnt'A' statistic| records'M' | '1' | 'h' | 0 | +-----+-----+-----+-----+--------------------------------------------------------+ | methodCnttimestamp methodof recordscurrent interval (datetime) | +-----------------------------------------------+ |
Configuration and Instrumentation Content Messages
Content messages are published when changes are made to the values of properties or statistics or when new management clients bind a queue to the management exchange.
No Format |
---|
+-----+-----+-----+-------+-----------------------+ | eventCnt'A' event| records'M' | '1' |'g/c/i'| seq | +-----+-----+-----+-------+-----------------------+--------+ | packageName (str8) | +-------------------------------------------------------------+ | className (str8) | +--------------------+ |
Each property record is an AMQP field table with the following fields. Optional fields may optionally be omitted from the field table.
field name | optional | description |
name | no | Name of the property |
type | no | Type code for the property |
access | no | Access code for the property |
index | no | 1 = index element, 0 = not an index element |
unit | yes | Units for numeric values (i.e. seconds, bytes, etc.) |
min | yes | Minimum value for numerics |
max | yes | Maximum value for numerics |
maxlen | yes | Maximum length for strings |
desc | yes | Description of the property |
Each statistic record is an AMQP field table with the following fields:
field name | optional | description |
name | no | Name of the statistic |
type | no | Type code for the statistic |
unit | yes | Units for numeric values (i.e. seconds, bytes, etc.) |
desc | yes | Description of the statistic |
method and event records contain a main field table that describes the method or header followed by zero or more field tables describing arguments. The main field table contains the following fields:
field name | optional | description |
name | no | Name of the method or event |
argCount | no | Number of argument records to follow |
desc | yes | Description of the method or event |
Argument field tables contain the following fields:
field name | method | event | optional | description |
name | yes | yes | no | Argument name |
type | yes | yes | no | Type code for the argument |
dir | yes | no | yes | Direction code for method arguments |
unit | yes | yes | yes | Units for numeric values (i.e. seconds, bytes, etc.) |
min | yes | no | yes | Minimum value for numerics |
max | yes | no | yes | Maximum value for numerics |
maxlen | yes | no | yes | Maximum length for strings |
desc | yes | yes | yes | Description of the argument |
default | yes | no | yes | Default value for the argument |
type codes are numerics with the following values:
value | type |
1 | uint8 |
2 | uint16 |
3 | uint32 |
4 | uint64 |
6 | short string |
7 | long string |
access codes are numerics with the following values:
value | access |
1 | Read-Create access |
2 | Read-Write access |
3 | Read-Only access |
direction codes are numerics with the following values:
value | direction |
1 | Input (from client to broker) |
2 | Output (from broker to client) |
3 | IO (bidirectional) |
Heartbeat Indication
No Format |
---|
+------------------------------------------+ | class hash (bin128) | +-----+-----+-----+-----+-----+-----+-----+-----+----------+ | timestamp of current sample (datetime) | +-----+-----+-----+-----+-----+-----+-----+-----+ | time object was created (datetime) | +-----+-----+-----+-----+-----+-----+-----+-----+ | time object was deleted (datetime) | +-----+-----+-----+-----+-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 'h' |objectId (uint64) 0 | +-----+-----+-----+-----+-----+-----+-------+------+ | timestamppresence ofbitmasks current(0 intervalor (datetime)more uint8 fields) | +-----+-----+-----+-----+-----+-----+-----+-----+---------+ |
Configuration and Instrumentation Content Messages
Content messages are published when changes are made to the values of properties or statistics or when new management clients bind a queue to the management exchange.
No Format |
---|
+-----+-----+-----+-------+-----------------------+ ---------------+ | config/inst values (in schema order) | 'A' | 'M' | '1' |'g/c/i'| seq | +-----+----------+-----+-------+-----------------------+--------+ | packageName (short string) | +--------------+ |
All timestamps are uint64 values representing nanoseconds since the epoch (January 1, 1970). The objectId is a uint64 value that uniquely identifies this object instance.
If any of the properties in the object are defined as optional, there will be 1 or more "presence bitmask" octets. There are as many octets as are needed to provide one bit per optional property. The bits are assigned to the optional properties in schema order (first octet first, lowest order bit first).
For example: If there are two optional properties in the schema called "option1" and "option2" (defined in that order), there will be one presence bitmask octet and the bits will be assigned as bit 0 controls option1 and bit 1 controls option2.
If the bit for a particular optional property is set (1), the property will be encoded normally in the "values" portion of the message. If the bit is clear (0), the property will be omitted from the list of encoded values and will be considered "NULL" or "not present".
The element values are encoded by their type into the message in the order in which they appeared in the schema message.
Get Query Message
A Get Request may be sent by the management console to cause a management agent to immediately send content information for objects of a class.
No Format |
---|
--------------------------------------------+ | className (short string) | +----------------------------------------------------------+ | class hash (bin128) | +-----+-----+-----+-----+-----+-----+-----+-----+----------+ | timestamp'A' of current sample (datetime)| 'M' | '1' | 'G' | seq | +-----+-----+-----+-----+-----+------------------+-----+-----+ | timeGet objectrequest wasfield createdtable (datetime) | +-----+-----+-----+-----+-----+-----+-----+-----+ | time object was deleted (datetime) | +-----+--------+-----+-----+-----+-----+-----+-----+ | objectId (uint64) | +-----+-----+-----+ |
The content of a get request is a field table that specifies what objects are being requested. Most of the fields are optional and are available for use in more extensive deployments.
Field Key | Mandatory | Type | Description |
"_class" | yes | short- |
...
string | The name of the class of objects being requested. | ||
"_package" | no | short-string | The name of the extension package the class belongs to. If omitted, the package defaults to "qpid" for access to objects in the connected broker. |
"_agent" | no | uuid | The management agent that is the target of the request. If omitted, agent defaults to the connected broker. |
When the management agent receives a get request, it sends content messages describing the requested objects. Once the last content message is sent, it then sends a Command Completion message with the same sequence number supplied in the request to indicate to the requestor that there are no more messages coming.
Method Request
Method request messages have the following structure. The sequence number is opaque to the management agent. It is returned unchanged in the method reply so the calling client can correctly associate the reply to the request. The objectId is the unique ID of the object on which the method is to be executed.
No Format |
---|
All timestamps are uint64 values representing nanoseconds since the epoch (January 1, 1970). The objectId is a uint64 value that uniquely identifies this object instance.
The element values are encoded by their type into the message in the order in which they appeared in the schema message.
Get Query Message
A Get Request may be sent by the management console to cause a management agent to immediately send content information for objects of a class.
No Format |
---|
+-----+-----+-----+-----+-----------------------+
| 'A' | 'M' | '1' | 'G' | seq |
+-----+-----+-----+-----+-----------------------+----------+
| Get request field table |
+----------------------------------------------------------+
|
The content of a get request is a field table that specifies what objects are being requested. Most of the fields are optional and are available for use in more extensive deployments.
Field Key | Mandatory | Type | Description |
"_class" | yes | short-string | The name of the class of objects being requested. |
"_package" | no | short-string | The name of the extension package the class belongs to. If omitted, the package defaults to "qpid" for access to objects in the connected broker. |
"_agent" | no | uuid | The management agent that is the target of the request. If omitted, agent defaults to the connected broker. |
When the management agent receives a get request, it sends content messages describing the requested objects. Once the last content message is sent, it then sends a Command Completion message with the same sequence number supplied in the request to indicate to the requestor that there are no more messages coming.
Method Request
Method request messages have the following structure. The sequence number is opaque to the management agent. It is returned unchanged in the method reply so the calling client can correctly associate the reply to the request. The objectId is the unique ID of the object on which the method is to be executed.
No Format |
---|
+-----+-----+-----+-----+-----------------------+
| 'A' | 'M' | '1' | 'M' | seq |
+-----+-----+-----+-----+-----------------------+
| objectId |
+-----------------------------------------------+------------------------+
| input and bidirectional argument values (in schema order) |
+------------------------------------------------------------------------+
|
Method Response
Method reply messages have the following structure. The sequence number is identical to that supplied in the method request. The status code (and text) indicate whether or not the method was successful and if not, what the error was. Output and bidirectional arguments are only included if the status code was 0 (STATUS_OK).
No Format |
---|
+-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 'm' | seq | +-----+-----+-----+-----+-----------------------+ | status code | +-----------------------+----------------------------------+ | status text (short string) | +-----+-----+-----+--------+----------------------------------+-------------+ | 'A' | output and bidirectional argument values (in schema order) 'M' | '1' | 'M' | seq | +-----+-----+-----+--------------------------+-------------------------------+ |
status code values are:
value | description |
0 | STATUS_OK - successful completion |
1 | STATUS_UNKNOWN_OBJECT - objectId not found in the agent |
2 | STATUS_UNKNOWN_METHOD - method is not known by the object type |
3 | STATUS_NOT_IMPLEMENTED - method is not currently implemented |
Messages for Extended Scenario
Extended Management Protocol
Qpid supports management extensions that allow the management broker to be a central point for the management of multiple external entities with their own management schemas.
No Format |
---|
-+ Broker | objectId (uint64) | +-----------------------------------------------+ | methodName (str8) Remote Agent | | +-----------------------------------------------+------------------------+ | input and bidirectional argument values (in schema order) | | <+---------------------------------------------------------------------------------- Attach Request --- |+ |
Method Response
Method reply messages have the following structure. The sequence number is identical to that supplied in the method request. The status code (and text) indicate whether or not the method was successful and if not, what the error was. Output and bidirectional arguments are only included if the status code was 0 (STATUS_OK).
No Format |
---|
| +--- Attach Response --+-----+-----+-----+-----------------------> |+ | | | 'A' | 'M' | '1' | 'm' | seq | +-----+-----+-----+-----+-----------------------+ | status code | | +--------------- Package Query --------+----------------------------------> |+ | status text (str8) | | | <+-----------------------+----------------------------------+------------- Package Indication --- | + | output and bidirectional argument values (in schema order) | < +------------------------------------------ Package Indication --- | | <---------------------------+ |
status code values are:
value | description |
0 | STATUS_OK - successful completion |
1 | STATUS_UNKNOWN_OBJECT - objectId not found in the agent |
2 | STATUS_UNKNOWN_METHOD - method is not known by the object type |
3 | STATUS_NOT_IMPLEMENTED - method is not currently implemented |
Messages for Extended Scenario
Extended Management Protocol
Qpid supports management extensions that allow the management broker to be a central point for the management of multiple external entities with their own management schemas.
No Format |
---|
Broker--------- Command Complete --- | | Remote Agent | | | | | <----------------------------------------- Attach Request --- | | --- ClassAttach Query (package) Response ----------------------------------------> | | | | <--------------------------------------- ClassPackage Indication --- | | <--------------------------------------- ClassPackage Indication --- | | | | <--------------------------------------- Class Indication --- | | <--------------------------------------- Class Indication --- | | <--------------------------------------- Class Indication --- | | <--------------------------------------- Command Complete --- | | ----------- Class Indication --- | | <--------------------------------------- Class Indication --- | | | | --- Schema Request (class key) -----------------------------> | | <---------------------------------------- Schema Response --- | | | | --- Schema Request (class key) -----------------------------> | | <---------------------------------------- Schema Response --- | | | | | |
...
opcode | message | description |
'P' | Package Query | This message contains a schema package query request, requesting that the broker dump the list of known packages |
'p' | Package Indication | This message contains a schema package indication, identifying a package known by the broker |
'A' | Agent Attach Request | This message is sent by a remote agent when it wishes to attach to a management broker |
'a' | Agent Attach Response | The management broker sends this response if an attaching remote agent is permitted to join |
'Agent Attach Responsex' | Console Added Indication | This message is sent to all remote agents by the management broker when a new console binds to the management exchange |
Package Query
No Format |
---|
+-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 'P' | seq | +-----+-----+-----+-----+-----------------------+ |
...
No Format |
---|
+-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 'p' | seq | +-----+-----+-----+-----+-----------------------+----------+ | package name (short string)str8) | +----------------------------------------------------------+ |
...
No Format |
---|
+-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 'A' | seq | +-----+-----+-----+-----+-----------------------+----------+ | label (short string)str8) | +-----------------------+-----------------------------------+ | sessionsystem-id (uuid) | +-----------------------+----------------------------------+ | system-id (uuid)requested objId bank | +-----------------------+ |
Attach Response (success)
No Format |
---|
+-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 'a' | seq | +-----+-----+-----+-----+-----+------------------+ | assigned broker bank | +-----------------------+ | requestedassigned objId bank | +-----------------------+ |
...
Console Added Indication
No Format |
---|
+-----+-----+-----+-----+-----------------------+ | 'A' | 'M' | '1' | 'ax' | seq | +-----+-----+-----+-----+-----------------------+ | assigned objId bank | +-----------------------+ |