List of usage examples for javax.jms ObjectMessage clearProperties
void clearProperties() throws JMSException;
From source file:org.grouter.common.jms.QueueSenderDestination.java
/** * Helper method that simply puts key value pairs into the JMS header. * * @param message a serializable object instance * @param headerProperties properties to store in header for JMS message * * @return ObjectMessage an object message *//*from w ww.jav a 2 s . c om*/ private ObjectMessage createMessage(Serializable message, HashMap<String, String> headerProperties) { ObjectMessage msg = null; try { msg = this.queueSession.createObjectMessage(message); msg.clearProperties(); if (headerProperties != null) { for (String key : headerProperties.keySet()) { String value = headerProperties.get(key); msg.setStringProperty(key, value); } } } catch (JMSException e) { logger.warn("Failed setting header for message.", e); } return msg; }
From source file:org.grouter.common.jms.TopicSenderDestination.java
/** * <b>See documentation in {@link org.grouter.common.jms.AbstractSenderDestination#sendMessage(java.io.Serializable,java.util.HashMap)}.</b><br> * <br>/* w w w. java 2s .c om*/ * * @param message a serializable object instance * @param headerProperties properties to store in header for JMS message * * @return ObjectMessage an object message */ private ObjectMessage createMessage(Serializable message, HashMap<String, String> headerProperties) { ObjectMessage msg = null; try { msg = topicSession.createObjectMessage(message); msg.clearProperties(); if (headerProperties != null) { for (String key : headerProperties.keySet()) { String value = headerProperties.get(key); msg.setStringProperty(key, value); } } } catch (JMSException e) { logger.warn("Failed setting header for message.", e); } return msg; }