-
-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support defining and referencing protocol headers #551
Comments
This is not an RFC at stage 1, and i did not add that label (at least not consciously). |
asyncapi/bindings#64 captures the problem with the current AMQP bindings spec regarding protocol headers. |
#555 captures the need for bindings specs to provide schema objects for protocol headers. |
asyncapi/bindings#62 already existed and captures the need for guidance and conventions for defining bindings specs. |
#556 captures the need for runtime expressions to make it clear whether they are referring to a protocol header or an application header. |
#557 captures the need to support not only |
#558 captures the need to support message exchange patterns such as request-reply in AsyncAPI. |
As discussed in the SIG meeting on the 8th of June 2021 i have now submitted individual issues (see above) for the different parts of this umbrella-issue. I am therefore closing this issue. |
The definitions in the spec of the Message Object and Message Bindings Object currently do not provide a standardised way to define protocol headers or to refer to protocol headers (for example from the
correlationId
field in the message object). This leads to contradictory message bindings definitions and to message object definitions that are implicitly dependent on the binding being used.Typical examples for this are correlation ID and message ID and how they are transmitted in messages and referred to from an AsyncAPI document:
In this MQTT example,
CorrelId
is treated as an application header. But it's location is specified asMQMD/CorrelId
in the message object (not the message binding object). This makes the message object specific to MQTT, and not applicable to other protocols. For example, the same message object could not be used with JMS, because in JMS the correlation ID is a protocol header (JMSCorrelationID
), and it is not possible to refer to protocol headers from the message object. As another example, in HTTP correlation ID is conventionally passed as thex-correlation-id
(application or protocol?) header, so theMQMD/CorrelId
definition is not applicable to HTTP. The spec currently does not support writing a message object that defines the usage of correlation ID for MQTT and JMS and/or HTTP. Specifically, there is no way to express thatJMSCorrelationID
is a protocol header in JMS and refer to it from the message object.Another example relates to Message IDs: For example, in JMS one common pattern is for the sender to send two protocol headers
JMSMessageID
andJMSReplyTo
, and for the recipient to send response messages to the destination specified byJMSReplyTo
in the request message, withJMSCorrelationID
in the response message set to the value ofJMSMessageID
in the request message. All of these are protocol headers in JMS. AsyncAPI does not currently allow the definition of a message object (with or without binding objects) that can describe this situation.The way message objects and message bindings objects are defined in the spec has resulted in incompatible message bindings object definitions:
replyTo
(in the operation binding object, not the message binding object) as a fixed string field (not a Schema object), although it would typically be set dynamically in each request message (as in the above example).Also note that the approach taken by the HTTP message binding requires most AsyncAPI docs to define schema objects for the common HTTP protocol headers, although they are known in advance and common. Instead, protocol header schema objects should be part of the bindings specification.
In summary, the AsyncAPI spec should be extended with a standardised way
correlationId
field in the message objectThe text was updated successfully, but these errors were encountered: