mirror of https://github.com/apache/activemq.git
added support for temporary destinations and support more polymorphic request/reply logic in clients
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@508489 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ee64b03ff5
commit
1a33eb61fb
|
@ -73,11 +73,21 @@ public class LegacyFrameTranslator implements FrameTranslator
|
||||||
|
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
if (amq_d.isQueue()) {
|
if (amq_d.isQueue()) {
|
||||||
|
if (amq_d.isTemporary()) {
|
||||||
|
buffer.append("/temp-queue/");
|
||||||
|
}
|
||||||
|
else {
|
||||||
buffer.append("/queue/");
|
buffer.append("/queue/");
|
||||||
}
|
}
|
||||||
if (amq_d.isTopic()) {
|
}
|
||||||
|
else {
|
||||||
|
if (amq_d.isTemporary()) {
|
||||||
|
buffer.append("/temp-topic/");
|
||||||
|
}
|
||||||
|
else {
|
||||||
buffer.append("/topic/");
|
buffer.append("/topic/");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
buffer.append(p_name);
|
buffer.append(p_name);
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
@ -94,9 +104,17 @@ public class LegacyFrameTranslator implements FrameTranslator
|
||||||
String t_name = name.substring("/topic/".length(), name.length());
|
String t_name = name.substring("/topic/".length(), name.length());
|
||||||
return ActiveMQDestination.createDestination(t_name, ActiveMQDestination.TOPIC_TYPE);
|
return ActiveMQDestination.createDestination(t_name, ActiveMQDestination.TOPIC_TYPE);
|
||||||
}
|
}
|
||||||
|
else if (name.startsWith("/temp-queue/")) {
|
||||||
|
String t_name = name.substring("/temp-queue/".length(), name.length());
|
||||||
|
return ActiveMQDestination.createDestination(t_name, ActiveMQDestination.TEMP_QUEUE_TYPE);
|
||||||
|
}
|
||||||
|
else if (name.startsWith("/temp-topic/")) {
|
||||||
|
String t_name = name.substring("/temp-topic/".length(), name.length());
|
||||||
|
return ActiveMQDestination.createDestination(t_name, ActiveMQDestination.TEMP_TOPIC_TYPE);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
throw new ProtocolException("Illegal destination name: [" + name + "] -- ActiveMQ STOMP destinations " +
|
throw new ProtocolException("Illegal destination name: [" + name + "] -- ActiveMQ STOMP destinations " +
|
||||||
"must begine with /queue/ or /topic/");
|
"must begine with one of: /queue/ /topic/ /temp-queue/ /temp-topic/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -428,8 +428,14 @@ public class ProtocolConverter {
|
||||||
|
|
||||||
responseHeaders.put(Stomp.Headers.Connected.SESSION, connectionInfo.getClientId());
|
responseHeaders.put(Stomp.Headers.Connected.SESSION, connectionInfo.getClientId());
|
||||||
String requestId = (String) headers.get(Stomp.Headers.Connect.REQUEST_ID);
|
String requestId = (String) headers.get(Stomp.Headers.Connect.REQUEST_ID);
|
||||||
|
if (requestId == null) {
|
||||||
|
// TODO legacy
|
||||||
|
requestId = (String) headers.get(Stomp.Headers.RECEIPT_REQUESTED);
|
||||||
|
}
|
||||||
if( requestId !=null ){
|
if( requestId !=null ){
|
||||||
|
// TODO legacy
|
||||||
responseHeaders.put(Stomp.Headers.Connected.RESPONSE_ID, requestId);
|
responseHeaders.put(Stomp.Headers.Connected.RESPONSE_ID, requestId);
|
||||||
|
responseHeaders.put(Stomp.Headers.Response.RECEIPT_ID, requestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
StompFrame sc = new StompFrame();
|
StompFrame sc = new StompFrame();
|
||||||
|
@ -441,7 +447,6 @@ public class ProtocolConverter {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onStompDisconnect(StompFrame command) throws ProtocolException {
|
protected void onStompDisconnect(StompFrame command) throws ProtocolException {
|
||||||
|
@ -483,9 +488,7 @@ public class ProtocolConverter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActiveMQMessage convertMessage(StompFrame command) throws IOException, JMSException {
|
public ActiveMQMessage convertMessage(StompFrame command) throws IOException, JMSException {
|
||||||
|
|
||||||
ActiveMQMessage msg = frameTranslator.convertFrame(command);
|
ActiveMQMessage msg = frameTranslator.convertFrame(command);
|
||||||
|
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue