@Test public void testJMSMessageHeadersAreCopied() throws JMSException { JmsMessage source = new JmsMessage(new JmsTestMessageFacade()); JmsMessage target = new JmsMessage(new JmsTestMessageFacade()); JmsTopic destination = new JmsTopic(DESTINATION_NAME); JmsTopic replyTo = new JmsTopic("ReplyTp:" + DESTINATION_NAME); source.setJMSMessageID("ID:TEST"); source.setJMSCorrelationID("ID:CORRELATION"); source.setJMSReplyTo(replyTo); source.setJMSDestination(destination); source.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT); source.setJMSDeliveryTime(10000); source.setJMSRedelivered(true); source.setJMSType("test-type"); source.setJMSExpiration(15000); source.setJMSPriority(7); source.setJMSTimestamp(5000); JmsMessageTransformation.copyProperties(createMockJmsConnection(), source, target); assertEquals("ID:TEST" , target.getJMSMessageID()); assertEquals("ID:CORRELATION", target.getJMSCorrelationID()); assertEquals(replyTo, target.getJMSReplyTo()); assertEquals(destination, target.getJMSDestination()); assertEquals(DeliveryMode.NON_PERSISTENT, target.getJMSDeliveryMode()); assertEquals(10000, target.getJMSDeliveryTime()); assertEquals(true, target.getJMSRedelivered()); assertEquals("test-type", target.getJMSType()); assertEquals(15000, target.getJMSExpiration()); assertEquals(7, target.getJMSPriority()); assertEquals(5000, target.getJMSTimestamp()); }
public static void copyProperties(JmsConnection connection, Message source, JmsMessage target) throws JMSException { target.setJMSMessageID(source.getJMSMessageID()); target.setJMSCorrelationID(source.getJMSCorrelationID()); target.setJMSReplyTo(transformDestination(connection, source.getJMSReplyTo())); target.setJMSDestination(transformDestination(connection, source.getJMSDestination())); target.setJMSDeliveryMode(source.getJMSDeliveryMode()); target.setJMSDeliveryTime(getForeignMessageDeliveryTime(source)); target.setJMSRedelivered(source.getJMSRedelivered()); target.setJMSType(source.getJMSType()); target.setJMSExpiration(source.getJMSExpiration()); target.setJMSPriority(source.getJMSPriority()); target.setJMSTimestamp(source.getJMSTimestamp()); Enumeration<?> propertyNames = source.getPropertyNames(); while (propertyNames.hasMoreElements()) { String name = propertyNames.nextElement().toString(); Object obj = source.getObjectProperty(name); target.setObjectProperty(name, obj); } }
JmsMessageTransformation { public static void copyProperties(JmsConnection connection, Message source, JmsMessage target) throws JMSException { target.setJMSMessageID(source.getJMSMessageID()); target.setJMSCorrelationID(source.getJMSCorrelationID()); target.setJMSReplyTo(transformDestination(connection, source.getJMSReplyTo())); target.setJMSDestination(transformDestination(connection, source.getJMSDestination())); target.setJMSDeliveryMode(source.getJMSDeliveryMode()); target.setJMSDeliveryTime(getForeignMessageDeliveryTime(source)); target.setJMSRedelivered(source.getJMSRedelivered()); target.setJMSType(source.getJMSType()); target.setJMSExpiration(source.getJMSExpiration()); target.setJMSPriority(source.getJMSPriority()); target.setJMSTimestamp(source.getJMSTimestamp()); Enumeration<?> propertyNames = source.getPropertyNames(); while (propertyNames.hasMoreElements()) { String name = propertyNames.nextElement().toString(); Object obj = source.getObjectProperty(name); target.setObjectProperty(name, obj); } } }
JmsMessageTransformation { public static void copyProperties(JmsConnection connection, Message source, JmsMessage target) throws JMSException { target.setJMSMessageID(source.getJMSMessageID()); target.setJMSCorrelationID(source.getJMSCorrelationID()); target.setJMSReplyTo(transformDestination(connection, source.getJMSReplyTo())); target.setJMSDestination(transformDestination(connection, source.getJMSDestination())); target.setJMSDeliveryMode(source.getJMSDeliveryMode()); target.setJMSDeliveryTime(getForeignMessageDeliveryTime(source)); target.setJMSRedelivered(source.getJMSRedelivered()); target.setJMSType(source.getJMSType()); target.setJMSExpiration(source.getJMSExpiration()); target.setJMSPriority(source.getJMSPriority()); target.setJMSTimestamp(source.getJMSTimestamp()); Enumeration<?> propertyNames = source.getPropertyNames(); while (propertyNames.hasMoreElements()) { String name = propertyNames.nextElement().toString(); Object obj = source.getObjectProperty(name); target.setObjectProperty(name, obj); } }  }
JmsMessageTransformation { public static void copyProperties(JmsConnection connection, Message source, JmsMessage target) throws JMSException { target.setJMSMessageID(source.getJMSMessageID()); target.setJMSCorrelationID(source.getJMSCorrelationID()); target.setJMSReplyTo(transformDestination(connection, source.getJMSReplyTo())); target.setJMSDestination(transformDestination(connection, source.getJMSDestination())); target.setJMSDeliveryMode(source.getJMSDeliveryMode()); target.setJMSDeliveryTime(getForeignMessageDeliveryTime(source)); target.setJMSRedelivered(source.getJMSRedelivered()); target.setJMSType(source.getJMSType()); target.setJMSExpiration(source.getJMSExpiration()); target.setJMSPriority(source.getJMSPriority()); target.setJMSTimestamp(source.getJMSTimestamp()); Enumeration<?> propertyNames = source.getPropertyNames(); while (propertyNames.hasMoreElements()) { String name = propertyNames.nextElement().toString(); Object obj = source.getObjectProperty(name); target.setObjectProperty(name, obj); } }  static JmsDestination transformDestination(JmsConnection connection, Destination destination); static JmsMessage transformMessage(JmsConnection connection, Message message); static void copyProperties(JmsConnection connection, Message source, JmsMessage target); static void setUnresolvedDestinationHandler(JmsUnresolvedDestinationTransformer handler); static JmsUnresolvedDestinationTransformer getUnresolvedDestinationTransformer(); }
JmsMessageTransformation { public static void copyProperties(JmsConnection connection, Message source, JmsMessage target) throws JMSException { target.setJMSMessageID(source.getJMSMessageID()); target.setJMSCorrelationID(source.getJMSCorrelationID()); target.setJMSReplyTo(transformDestination(connection, source.getJMSReplyTo())); target.setJMSDestination(transformDestination(connection, source.getJMSDestination())); target.setJMSDeliveryMode(source.getJMSDeliveryMode()); target.setJMSDeliveryTime(getForeignMessageDeliveryTime(source)); target.setJMSRedelivered(source.getJMSRedelivered()); target.setJMSType(source.getJMSType()); target.setJMSExpiration(source.getJMSExpiration()); target.setJMSPriority(source.getJMSPriority()); target.setJMSTimestamp(source.getJMSTimestamp()); Enumeration<?> propertyNames = source.getPropertyNames(); while (propertyNames.hasMoreElements()) { String name = propertyNames.nextElement().toString(); Object obj = source.getObjectProperty(name); target.setObjectProperty(name, obj); } }  static JmsDestination transformDestination(JmsConnection connection, Destination destination); static JmsMessage transformMessage(JmsConnection connection, Message message); static void copyProperties(JmsConnection connection, Message source, JmsMessage target); static void setUnresolvedDestinationHandler(JmsUnresolvedDestinationTransformer handler); static JmsUnresolvedDestinationTransformer getUnresolvedDestinationTransformer();  }