Class SolaceJcsmpBaseTranslatorImp
- All Implemented Interfaces:
SolaceJcsmpMessageTranslator
- Direct Known Subclasses:
SolaceJcsmpBytesMessageTranslator
,SolaceJcsmpBytesXmlMessageTranslator
,SolaceJcsmpTextMessageTranslator
,SolaceJcsmpXmlContentMessageTranslator
Once a message has been consumed from Solace, this translator will generate an AdaptrisMessage
from the
payload and headers of the consumed message.
Reverse translation when producing a message to a Solace end-point will create a Solace XMLMessage again from the
payload and metadata of the AdaptrisMessage
The payload mapping is straight forward, but the metadata and header mapping does require a little configuration. In the advanced settings you can specify metadata keys against each Solace message property; when consuming we will copy the value from the Solace message into the specified metadata key and when producing we will source the value for the Solace header from the specified metadata key.
User data is slightly different however, when consuming we will copy all Solace User data into metadata, when producing you will set a metadata filter where we will copy metadata keys and values into the outgoing Solace message User data.
In the adapter configuration file this class is aliased as solace-jcsmp-bytes-message-translator which is the preferred alternative to the fully qualified classname when building your configuration.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static enum
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Copy the JCSMP message properties into metadata when we consume a message.boolean
Apply per message properties resolution when we produce a JCSMP message.The mode of delivery; "PERSISTENT / NONPERSISTENT"Defaults to the standardDefaultMessageFactory
.protected abstract com.solacesystems.jcsmp.XMLMessage
protected abstract void
performPayloadTranslation
(com.solacesystems.jcsmp.XMLMessage source, AdaptrisMessage destination) void
setApplyPerMessagePropertiesOnConsume
(boolean applyPerMessagePropertiesOnConsume) Copy the JCSMP message properties into metadata when we consume a message.void
setApplyPerMessagePropertiesOnProduce
(boolean applyPerMessagePropertiesOnProduce) Apply per message properties resolution when we produce a JCSMP message.void
setDeliveryMode
(String deliveryMode) The mode of delivery; "PERSISTENT / NONPERSISTENT"void
setMessageFactory
(AdaptrisMessageFactory messageFactory) Defaults to the standardDefaultMessageFactory
.void
setMetadataFilter
(MetadataFilter metadataFilter) void
setPerMessageProperties
(SolaceJcsmpPerMessageProperties perMessageProperties) void
setTypeMappings
(List<SolaceJcsmpUserDataTypeMapping> typeMappings) com.solacesystems.jcsmp.XMLMessage
translate
(AdaptrisMessage message) translate
(com.solacesystems.jcsmp.XMLMessage message)
-
Constructor Details
-
SolaceJcsmpBaseTranslatorImp
public SolaceJcsmpBaseTranslatorImp()
-
-
Method Details
-
translate
- Specified by:
translate
in interfaceSolaceJcsmpMessageTranslator
- Throws:
Exception
-
translate
- Specified by:
translate
in interfaceSolaceJcsmpMessageTranslator
- Throws:
Exception
-
performPayloadTranslation
protected abstract com.solacesystems.jcsmp.XMLMessage performPayloadTranslation(AdaptrisMessage source) -
performPayloadTranslation
protected abstract void performPayloadTranslation(com.solacesystems.jcsmp.XMLMessage source, AdaptrisMessage destination) -
metadataFilter
-
getMessageFactory
Defaults to the standardDefaultMessageFactory
. -
setMessageFactory
Defaults to the standardDefaultMessageFactory
.- Parameters:
messageFactory
-
-
getDeliveryMode
The mode of delivery; "PERSISTENT / NONPERSISTENT" -
setDeliveryMode
The mode of delivery; "PERSISTENT / NONPERSISTENT"- Parameters:
deliveryMode
-
-
getPerMessageProperties
-
setPerMessageProperties
-
getApplyPerMessagePropertiesOnProduce
public boolean getApplyPerMessagePropertiesOnProduce()Apply per message properties resolution when we produce a JCSMP message. -
setApplyPerMessagePropertiesOnProduce
public void setApplyPerMessagePropertiesOnProduce(boolean applyPerMessagePropertiesOnProduce) Apply per message properties resolution when we produce a JCSMP message. -
getApplyPerMessagePropertiesOnConsume
public boolean getApplyPerMessagePropertiesOnConsume()Copy the JCSMP message properties into metadata when we consume a message. -
setApplyPerMessagePropertiesOnConsume
public void setApplyPerMessagePropertiesOnConsume(boolean applyPerMessagePropertiesOnConsume) Copy the JCSMP message properties into metadata when we consume a message. -
getTypeMappings
-
setTypeMappings
-
getMetadataFilter
-
setMetadataFilter
-