-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Proposal
For trace-context we decided to use to use all lowercase alphabetic characters to make the header usable in non HTTP scenarios. Message queues such as JMS are more restrictive than HTTP in regards to header names. If we expect to propagate Correlation Context over protocols other than HTTP, we should consider using the same naming conventions as used for trace-context and name this header correlationcontext.
The rationale for this change is the same as the rationale for Trace Context headers. See: https://github.com/w3c/trace-context/blob/master/http_header_format_rationale.md#lowercase-concatenated-header-names
Some benefits of having an alphabetic lowercase header name:
- Maximizes the scenarios that this header name can be used in
- HTTP headers,
- key-value based systems of all kinds
- Reduces friction to adoption
- There is only one canonical representation of the header that needs to looked up
Known Issues
Incompatible as a JMS Header
Correlation-Context is incompatible as a JMS header due to the - character.
Section 3.8.1.1 (Message Selector Syntax) of the JMS Specification states:
Identifiers:
- An identifier is an unlimited length character sequence that must begin with a Java identifier start character and all following characters must be Java identifier part characters. An identifier start character is any character for which the method
Character.isJavaIdentifierStartreturns true. This includes ‘_’ and ‘$’. An identifier part character is any character for which the methodCharacter.isJavaIdentifierPartreturns true.
Example:
import java.lang.*;
public class IdentifierDemo {
public static void main(String[] args) {
char dash = '-';
boolean dashValid = Character.isJavaIdentifierPart(dash);
System.out.println("Dash valid?: " + dashValid);
}
}Output:
$javac IdentifierDemo.java
$java -Xmx128M -Xms16M IdentifierDemo
Dash valid?: false