mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-3146 - original destination from stomp
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1060871 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b026971933
commit
600c7c2c7c
|
@ -77,6 +77,10 @@ public interface FrameTranslator {
|
|||
if (message.getUserID() != null) {
|
||||
headers.put(Stomp.Headers.Message.USERID, message.getUserID());
|
||||
}
|
||||
|
||||
if (message.getOriginalDestination() != null) {
|
||||
headers.put(Stomp.Headers.Message.ORIGINAL_DESTINATION, ft.convertDestination(converter, message.getOriginalDestination()));
|
||||
}
|
||||
|
||||
// now lets add all the message headers
|
||||
final Map<String, Object> properties = message.getProperties();
|
||||
|
|
|
@ -82,6 +82,7 @@ public interface Stomp {
|
|||
String TYPE = "type";
|
||||
String SUBSCRIPTION = "subscription";
|
||||
String USERID = "JMSXUserID";
|
||||
String ORIGINAL_DESTINATION = "original-destination";
|
||||
}
|
||||
|
||||
public interface Subscribe {
|
||||
|
|
|
@ -1408,6 +1408,25 @@ public class StompTest extends CombinationTestSupport {
|
|||
|
||||
}
|
||||
|
||||
public void testExpire() throws Exception {
|
||||
stompConnection.connect("system", "manager");
|
||||
|
||||
HashMap<String, String> headers = new HashMap<String, String>();
|
||||
long timestamp = System.currentTimeMillis();
|
||||
headers.put(Stomp.Headers.Message.EXPIRATION_TIME, String.valueOf(timestamp));
|
||||
headers.put(Stomp.Headers.Send.PERSISTENT, "true");
|
||||
|
||||
|
||||
stompConnection.send("/queue/" + getQueueName(), "msg", null, headers);
|
||||
|
||||
stompConnection.subscribe("/queue/ActiveMQ.DLQ");
|
||||
StompFrame stompMessage = stompConnection.receive(1000);
|
||||
assertNotNull(stompMessage);
|
||||
assertEquals(stompMessage.getHeaders().get(Stomp.Headers.Message.ORIGINAL_DESTINATION), "/queue/" + getQueueName());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected void assertClients(int expected) throws Exception {
|
||||
org.apache.activemq.broker.Connection[] clients = broker.getBroker().getClients();
|
||||
|
|
Loading…
Reference in New Issue