public final class JmsMessageHelper extends Object
Message.| Modifier and Type | Field and Description |
|---|---|
static String |
JMS_CORRELATION_ID
Set by the publishing Client
|
static String |
JMS_DELIVERY_MODE
Set on the send or publish event
|
static String |
JMS_DESTINATION
Set on the send or publish event
|
static String |
JMS_EXPIRATION
Set on the send or publish event
|
static String |
JMS_MESSAGE_ID
Set on the send or publish event
|
static String |
JMS_PRIORITY
Set on the send or publish event
|
static String |
JMS_REDELIVERED
A redelivery flag set by the JMS provider
|
static String |
JMS_REPLY_TO
The JMS Reply To
Destination set by the publishing Client |
static String |
JMS_TIMESTAMP
Set on the send or publish event
|
static String |
JMS_TYPE
Set by the publishing Client
|
| Modifier and Type | Method and Description |
|---|---|
static javax.jms.Message |
createMessage(javax.jms.Session session,
Object payload,
Map<String,Object> messageHeaders,
KeyFormatStrategy keyFormatStrategy) |
static javax.jms.Message |
createMessage(javax.jms.Session session,
Object payload,
Map<String,Object> messageHeaders,
KeyFormatStrategy keyFormatStrategy,
boolean allowNullBody) |
static JmsMessageType |
discoverJmsMessageType(javax.jms.Message message) |
static JmsMessageType |
discoverMessgeTypeFromPayload(Object payload) |
static void |
setCorrelationId(javax.jms.Message message,
String correlationId)
Sets the correlation id on the JMS message.
|
static void |
setJMSDeliveryMode(javax.jms.Message message,
Object deliveryMode)
Sets the JMSDeliveryMode on the message.
|
static javax.jms.Message |
setJmsMessageHeaders(javax.jms.Message jmsMessage,
Map<String,Object> messageHeaders,
KeyFormatStrategy keyFormatStrategy)
Adds or updates the
Message headers. |
static void |
setMessageType(javax.jms.Message message,
String type)
Sets the correlation id on the JMS message.
|
static void |
setProperty(javax.jms.Message jmsMessage,
String name,
Object value)
Sets the property on the given JMS message.
|
public static final String JMS_CORRELATION_ID
public static final String JMS_DELIVERY_MODE
public static final String JMS_DESTINATION
public static final String JMS_EXPIRATION
public static final String JMS_MESSAGE_ID
public static final String JMS_PRIORITY
public static final String JMS_REDELIVERED
public static final String JMS_REPLY_TO
Destination set by the publishing Clientpublic static final String JMS_TIMESTAMP
public static final String JMS_TYPE
public static javax.jms.Message createMessage(javax.jms.Session session,
Object payload,
Map<String,Object> messageHeaders,
KeyFormatStrategy keyFormatStrategy)
throws Exception
Exceptionpublic static javax.jms.Message createMessage(javax.jms.Session session,
Object payload,
Map<String,Object> messageHeaders,
KeyFormatStrategy keyFormatStrategy,
boolean allowNullBody)
throws Exception
Exceptionpublic static javax.jms.Message setJmsMessageHeaders(javax.jms.Message jmsMessage,
Map<String,Object> messageHeaders,
KeyFormatStrategy keyFormatStrategy)
throws IllegalHeaderException
Message headers. Header names and values are
checked for JMS 1.1 compliance.jmsMessage - the Message to add or update the headers onmessageHeaders - a Map of String/Object pairskeyFormatStrategy - the a KeyFormatStrategy to used to
format keys in a JMS 1.1 compliant manner. If null the
DefaultJmsKeyFormatStrategy will be used.MessageException - aIllegalHeaderExceptionpublic static void setJMSDeliveryMode(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 void setMessageType(javax.jms.Message message,
String type)
message - the JMS messagetype - the correlation idpublic static void setCorrelationId(javax.jms.Message message,
String correlationId)
message - the JMS messagecorrelationId - the correlation idpublic 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 JmsMessageType discoverMessgeTypeFromPayload(Object payload)
public static JmsMessageType discoverJmsMessageType(javax.jms.Message message)
Apache Camel