All services always have access to the attributes that describe in a general way the request being handled. Additionally, protocol-specific attributes, such as
self.request.http, cover details pertaining to information that is specific to a particular protocol.
Most commonly accessed attributes are:
|Used to access incoming data if data models are used
|Used to access incoming data if data models are not used
|Used to access incoming data in exactly the same format as it was received by the service, prior to any parsing or transformations
The chapter first details common attributes and then goes into particulars of each protocol-specific part.
Attributes listed in this section are available to all services, regardless of what kind of a channel they are invoked over, be it HTTP, AMQP, ZeroMQ, scheduler, SQL notifications or any other.
|Along with self.channel, one of the main attributes describing incoming messages
|Input message exactly as it was received, byte-for-byte, prior to any transformations or parsing attempts on Zato end
|Input message after parsing it into a channel-specific data format. For JSON messages, this will be a Bunch object. Available only if data models are used.
|Input message after parsing it into a channel-specific data format. For JSON messages, this will be a dict object. Available even if data models are not used.
|Along with self.request, describes data and metadata about incoming messages. Unlike self.request, this attribute is the same for all requests coming through the same channel, i.e. it describes details of the channel itself rather than each individual message received.
|Name of the channel the request was received through
|Type of the channel - will be equal to one of the constants in zato.common.CHANNEL
|Alias to self.channel
|Describes a security definition attached to the channel, if any is at all
|Name of the security definition
|Username used to invoke the channel, if applicable for a particular security type
|Type of the security definition - will be equal to one of the constants in zato.common.SEC_DEF_TYPE
|Alias to self.channel.security
|The attribute to use to access HTTP-specific information
|HTTP method used to invoke the service
|All GET parameters as a Bunch object, each value is either an exact one received or a list of values if there was more than one for a given key
|All POST parameters as a Bunch object, each value is either an exact one received or a list of values if there was more than one for a given key. Available only if there is no data format set for channel.
|URL path that the request was received through, e.g. /customer/123 in "https://localhost:17010/customer/123"; the value does not include a query string
|A dict-like object with a concatenation of query string and path parameters. Available even if data models are not used.
|While not belonging directly to self.request.http, each service can always have access to the full WSGI dictionary of data and metadata about the request
|The attribute to use to access AMQP-specific information
|Low-level object representing the incoming message
|Used by services to acknowledge the reception of a message
|Used by services to reject a message back to the AMQP broker
|The attribute to use to access IBM MQ-specific information
|Timestamp of when the message was created
|Date part of when the message was enqueued
|Time part of when the message was enqueued
|To what queue responses should be sent, if any are expected
|The whole MQMD header as it was received from MQ
|The same as self.request.raw_request - added for convenience