jmesnil/stomp-websocket — pull request #20 by aashley (2012-09-20 03:20:14+00:00)
Title: Allow ID header to be set manually when subscribing to a destination

RabbitMQ's durable topic subscription within it's STOMP plugin uses the ID header on the subscription request in combination with the topic being subscribed to to generate a unique queue name that messages from the topic are dropped into for later retrieval by a reconnecting client.

With the existing code in stomp-websocket the subscription ID is based on the number and order of subscriptions being made. A change in the order that subscriptions are made can cause this ID change thus meaning that messages waiting for this client to reconnect will no longer be accessible.

My change to subscribe will leave an ID header allow if it exists and is longer than 0 characters. Otherwise the old behaviour of generating a subscription ID will be used.