This closes #76 stomp changes

This commit is contained in:
Clebert Suconic 2015-07-13 16:50:36 -04:00
commit 2e9705cd97
2 changed files with 17 additions and 2 deletions

View File

@ -491,7 +491,7 @@ public final class StompConnection implements RemotingConnection
{
//not a supported version!
ActiveMQStompException error = BUNDLE.versionNotSupported(acceptVersion);
error.addHeader(Stomp.Headers.Error.VERSION, acceptVersion);
error.addHeader(Stomp.Headers.Error.VERSION, manager.getSupportedVersionsAsErrorVersion());
error.addHeader(Stomp.Headers.CONTENT_TYPE, "text/plain");
error.setBody("Supported protocol versions are " + manager.getSupportedVersionsAsString());
error.setDisconnect(true);

View File

@ -379,7 +379,22 @@ class StompProtocolManager implements ProtocolManager<StompFrameInterceptor>, No
public String getSupportedVersionsAsString()
{
return "v" + StompVersions.V1_0 + " v" + StompVersions.V1_1 + " v" + StompVersions.V1_2;
String versions = "";
for (StompVersions version : StompVersions.values())
{
versions += " v" + version;
}
return versions.substring(1);
}
public String getSupportedVersionsAsErrorVersion()
{
String versions = "";
for (StompVersions version : StompVersions.values())
{
versions += "," + version;
}
return versions.substring(1);
}
public String getVirtualHostName()