@Test public void testJMSMessagePropertiesAreCopied() throws JMSException { JmsMessage source = new JmsMessage(new JmsTestMessageFacade()); JmsMessage target = new JmsMessage(new JmsTestMessageFacade()); source.setJMSType("text/test"); source.setBooleanProperty("boolValue", true); source.setStringProperty("stringValue", "foo"); JmsMessageTransformation.copyProperties(createMockJmsConnection(), source, target); assertEquals(true, target.getBooleanProperty("boolValue")); assertEquals("foo", target.getStringProperty("stringValue")); assertEquals("text/test", target.getJMSType()); }
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();  }