git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1060871 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2011-01-19 17:15:38 +00:00
parent b026971933
commit 600c7c2c7c
3 changed files with 24 additions and 0 deletions

View File

@ -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();

View File

@ -82,6 +82,7 @@ public interface Stomp {
String TYPE = "type";
String SUBSCRIPTION = "subscription";
String USERID = "JMSXUserID";
String ORIGINAL_DESTINATION = "original-destination";
}
public interface Subscribe {

View File

@ -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();