tabish...@gmail.com wrote
> 
> On Mon, 2012-07-23 at 11:23 +0100, Gary Tully wrote: 
>> So the root problem is the php client having space between the ':'
>> header key value separator that used to be trimmed.
> 

Thank you both for your responses.  I did read somewhere about trimming, and
a decision was made that no trimming should be done, in case values are sent
that were supposed to include either leading or trailing whitespace.  In the
case of login and password headers this may sound whacky, but I'd support
the premise for all others.  The Stomp 1.0 and 1.1 specs I linked to above
clearly show the 1.0 spec including a space and the 1.1 spec not including a
space, but I haven't read them in detail to see if this is considered
optional or if a trimming preference can be specified during connection.

>From the 1.1 spec:


> The STOMP 1.0 specification included many example frames with padding in
> the headers and many servers and clients were implemented to trim or pad
> header values. This causes problems if applications want to send headers
> that SHOULD not get trimmed. In STOMP 1.1, clients and servers MUST never
> trim or pad headers with spaces.
> 

Sounds to me that this immediately breaks 1.0 clients talking to a 1.1
server i.e. the Stomp protocol is not backwardly compatible.  The 1.0 client
will probably send "login: username" and the 1.1 server MUST interpret this
as a username of " username" just as I experienced.  Thus, it is critical
that the server recognise the spec being used by the client and process it
accordingly.


tabish...@gmail.com wrote
> 
> On Mon, 2012-07-23 at 11:23 +0100, Gary Tully wrote: 
>> Seems like there is a need to make the 1.1 compliant behavior
>> introduced in https://issues.apache.org/jira/browse/AMQ-3823
>> configurable.
>> As in, have the option to force 1.0 (or existing amq) behavior when
>> the 1.1 version header is not present in a connect.
>> In fact, that seems like a sensible default.
> 

Ah, I know very little about these protocols, if there's a 1.1 version
header (the 'handshaking' I thought was missing in my comments above) then
great, the server can tell whether the client is a 1.0 or 1.1 client.  One
would think it could then gracefully degrade its protocol support to 1.0,
given that AMQ had working 1.0 support in 5.5.

A 1.0 CONNECT would look like:
CONNECT
login: <username>
passcode:<passcode>

A 1.1 CONNECT would look like:
CONNECT
accept-version:1.0,1.1,2.0
host:stomp.github.org

It's trivial for the server to detect a missing 'accept-version' header and
presume that it's a 1.0 protocol client.

It certainly amazes me that the AMQ merge that supports 1.1 seems to have
simply thrown 1.0 support out the window.  Is this really the case?


tabish...@gmail.com wrote
> 
> Even though its a bit vague, the Stomp 1.0 spec also requires that key /
> header values allow for space padding just as the 1.1 spec does, you can
> see this by examining the BNF for each spec.  If we are going to claim
> spec compliance then we probably shouldn't default to non-spec complaint
> behavior.  We could make it configurable but it seems like the right
> thing to do is to use an updated client that is also spec complaint
> instead of introducing yet another configuration option into the already
> large and not so well documented set of options we already have.  
> 

I'm a little confused by these comments.. the client I had was spec
compliant, with Stomp 1.0.  The problem as I see it is that AMQ has been
updated to no longer support Stomp 1.0.  In a perfect world, one should now
be able to use both the 1.0 client or 1.1 client against AMQ 5.6 and have
both work, everything be spec compliant, and no-one be crying into their
beer.  If the 1.1 spec allows for a connection header indicating the
protocol version number, it seems sensible to me to default to 1.0 spec
unless that header is present, and use the spec it indicates if it is
present.

Tim gave me the url to a git repo for the latest PHP Stomp client:

git://github.com/dejanb/stomp-php.git

>From a cursory inspection, this code lacks the space after the colon in
Frame.php and so does seem to formulate 1.1 frames.  Can this code please be
linked to from the activemq 'php' link, or anywhere else?  Or the fusesource
site at http://stomp.fusesource.org/download.html ? I did a fair bit of
digging around earlier and it just seemed like the internet had never heard
of Stomp 1.1 for PHP, except that ActiveMQ had been updated and broken all
available PHP Stomp clients.

I'll try using that github client tomorrow and hope it interoperates with
AMQ 5.6 properly, hopefully I can post back with results soon.  I presume my
existing PHP code, that uses the old 1.0 client, will break in 'interesting'
ways, so we'll see what happens.

Nick



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/5-5-to-5-6-upgrade-stomp-client-suddenly-gets-User-name-xyz-or-password-is-invalid-tp4654229p4654262.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to