public final class JmsMessageHelper extends Object
Message
.Modifier and Type | Method and Description |
---|---|
static String |
getJMSCorrelationIDAsBytes(javax.jms.Message message)
Gets the JMSCorrelationIDAsBytes from the message.
|
static String |
getJMSMessageID(javax.jms.Message message)
Gets the JMSMessageID from the message.
|
static Boolean |
getJMSRedelivered(javax.jms.Message message)
Gets the JMSRedelivered from the message.
|
static javax.jms.Destination |
getJMSReplyTo(javax.jms.Message message)
Gets the JMSReplyTo from the message.
|
static String |
getJMSType(javax.jms.Message message)
Gets the JMSType from the message.
|
static Object |
getProperty(javax.jms.Message jmsMessage,
String name)
Gets a JMS property
|
static String |
getStringProperty(javax.jms.Message message,
String propertyName)
Gets the String Properties from the message.
|
static boolean |
hasProperty(javax.jms.Message jmsMessage,
String name)
Tests whether a given property with the name exists
|
static boolean |
isQueuePrefix(String destination)
Whether the destination name has either queue or temp queue prefix.
|
static boolean |
isTopicPrefix(String destination)
Whether the destination name has either topic or temp topic prefix.
|
static String |
normalizeDestinationName(String destination)
Normalizes the destination name.
|
static String |
normalizeDestinationName(String destination,
boolean includePrefix)
Normalizes the destination name.
|
static Object |
removeJmsProperty(javax.jms.Message jmsMessage,
String name)
Removes the property from the JMS message.
|
static void |
setCorrelationId(javax.jms.Message message,
String correlationId)
Sets the correlation id on the JMS message.
|
static void |
setJMSDeliveryMode(org.apache.camel.Exchange exchange,
javax.jms.Message message,
Object deliveryMode)
Sets the JMSDeliveryMode on the message.
|
static void |
setJMSReplyTo(javax.jms.Message message,
javax.jms.Destination replyTo)
Sets the JMSReplyTo on the message.
|
static void |
setProperty(javax.jms.Message jmsMessage,
String name,
Object value)
Sets the property on the given JMS message.
|
public static Object removeJmsProperty(javax.jms.Message jmsMessage, String name) throws javax.jms.JMSException
jmsMessage
- the JMS messagename
- name of the property to removejavax.jms.JMSException
- can be thrownpublic static boolean hasProperty(javax.jms.Message jmsMessage, String name) throws javax.jms.JMSException
jmsMessage
- the JMS messagename
- name of the property to test if existsjavax.jms.JMSException
- can be thrownpublic static Object getProperty(javax.jms.Message jmsMessage, String name) throws javax.jms.JMSException
jmsMessage
- the JMS messagename
- name of the property to getjavax.jms.JMSException
- can be thrownpublic static void setProperty(javax.jms.Message jmsMessage, String name, Object value) throws javax.jms.JMSException
jmsMessage
- the JMS messagename
- name of the property to setvalue
- the valuejavax.jms.JMSException
- can be thrownpublic static void setCorrelationId(javax.jms.Message message, String correlationId)
message
- the JMS messagecorrelationId
- the correlation idpublic static boolean isQueuePrefix(String destination)
destination
- the destinationpublic static boolean isTopicPrefix(String destination)
destination
- the destinationpublic static String normalizeDestinationName(String destination)
destination
- the destinationpublic static String normalizeDestinationName(String destination, boolean includePrefix)
destination
- the destinationincludePrefix
- whether to include queue://, or topic:// prefix in the normalized destination namepublic static void setJMSReplyTo(javax.jms.Message message, javax.jms.Destination replyTo)
message
- the messagereplyTo
- the reply to destinationpublic static javax.jms.Destination getJMSReplyTo(javax.jms.Message message)
message
- the messagepublic static String getJMSType(javax.jms.Message message)
message
- the messagepublic static String getStringProperty(javax.jms.Message message, String propertyName)
message
- the messagepublic static Boolean getJMSRedelivered(javax.jms.Message message)
message
- the messagepublic static String getJMSMessageID(javax.jms.Message message)
message
- the messagepublic static void setJMSDeliveryMode(org.apache.camel.Exchange exchange, javax.jms.Message message, Object deliveryMode) throws javax.jms.JMSException
exchange
- the exchangemessage
- the messagedeliveryMode
- the delivery mode, either as a String or integerjavax.jms.JMSException
- is thrown if error setting the delivery modepublic static String getJMSCorrelationIDAsBytes(javax.jms.Message message)
message
- the messageApache Camel