This implies that it may be possible to get repeated header entries.
Generally I think the first value should be considered the latest
update of the header field. I could also see some header fields being
treated as holding an array of values, and each repeated header could
be an entry in that array.
--
Regards,
Hiram
Blog: http://hiramchirino.com
Open Source SOA
http://fusesource.com/
You can achieve the same thing without repeated headers:
foo:a -> foo:a b
foo:b
Both approaches are possible, we have to look at the consequences
(e.g. client side API) before choosing one.
Cheers,
Lionel
MESSAGE
comment:"1. Overview\n\nThis header is using encoded newlines."
destination:STOMP.SPEC
hello world
^@
I'm partial to having a repeated header just mean that a header value
was updated during the routing of the message. Newer/Updated headers
go on top. I think this is similar to how SMTP works no? The nice
part about that is the routing intermediaries and very efficiently
update header entries since they don't need to mutate the original
message. Further more, clients can inspect how header values changed
as the message was routed through intermediate nodes. For example,
first thing a broker does to a message is add an
'received-on:${hostname}:${port}' header before it does things like
add headers for message-id, or redelivery count etc. If the message
is being forwarded through a federation of brokers it could end up
looking like:
MESSAGE
redeliveries:3
received-on:foo.host.com:61613
message-id:123
redeliveries:1
received-on:bar.host.com:61613
destination:/queue/a
hello world
^@
A client that gets the above message should interpret the message as
it were just sent:
MESSAGE
redeliveries:3
received-on:foo.host.com:61613
message-id:123
destination:/queue/a
hello world
^@
What do you think?
--
Plus I think it makes the STOMP spec simpler in a way. The fact is
that duplicate headers COULD be in a frame. Making that an error
condition complicates implementations even more since they have to
check for the error condition. Making it the rule that only the first
value should be used simplifies it.
--
I'm probably biased because I wrote a STOMP client and not a STOMP
server but I have the feeling that we also have to look at the
consequences at the API level. What will the API user see?
When the library code parses "foo:bar", how can it know if "foo"
should be associated with a single value or with a list containing one
element?
In other words (sorry for the Perl code), will the user of the API see:
$header{foo} = "bar"
or
$header{foo} = [ "bar" ]
or something else?
Cheers,
Lionel
MESSAGE
foo:bar
foo:other
foo:you get the idea
^@
That API layers should just return "bar" to the user when he asks for
the "foo" header. This should maintain API compatibility with current
STOMP clients APIs. It's just that the 1.1 client libs would need to
make sure they ignore the subsequent duplicate header entries which
they may or may not be currently what they doing since the current
spec is does not specify what to do in this case.
Regards,
Hiram
--
This makes sense.
I vote for:
- JSON and more complex header structures in 2.0 only
- 1.1 to clearly specify how to handle repeated headers
(error, keep first or keep last)
- 1.1 to clarify character encoding in the header
Cheers,
Lionel
--