Send supported versions back in STOMP ERROR version
https://stomp.github.io/stomp-specification-1.2.html#Protocol_Negotiation
This commit is contained in:
parent
6199d4ee11
commit
9e41d961be
|
@ -491,7 +491,7 @@ public final class StompConnection implements RemotingConnection
|
||||||
{
|
{
|
||||||
//not a supported version!
|
//not a supported version!
|
||||||
ActiveMQStompException error = BUNDLE.versionNotSupported(acceptVersion);
|
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.addHeader(Stomp.Headers.CONTENT_TYPE, "text/plain");
|
||||||
error.setBody("Supported protocol versions are " + manager.getSupportedVersionsAsString());
|
error.setBody("Supported protocol versions are " + manager.getSupportedVersionsAsString());
|
||||||
error.setDisconnect(true);
|
error.setDisconnect(true);
|
||||||
|
|
|
@ -387,6 +387,16 @@ class StompProtocolManager implements ProtocolManager<StompFrameInterceptor>, No
|
||||||
return versions.substring(1);
|
return versions.substring(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSupportedVersionsAsErrorVersion()
|
||||||
|
{
|
||||||
|
String versions = "";
|
||||||
|
for (StompVersions version : StompVersions.values())
|
||||||
|
{
|
||||||
|
versions += "," + version;
|
||||||
|
}
|
||||||
|
return versions.substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
public String getVirtualHostName()
|
public String getVirtualHostName()
|
||||||
{
|
{
|
||||||
return "activemq";
|
return "activemq";
|
||||||
|
|
Loading…
Reference in New Issue