@ComponentProfile(summary="Place message on a JMS Topic", tag="producer,jms", recommended=JmsConnection.class) public class PasProducer extends DefinedJmsProducer
AdaptrisMessageProducer
implementation for Topic based JMS.
This implementation baselines to JMS 1.1 for minimum API support and its behaviour and support for standard JMS Headers can be controlled in a number of ways.
When converting from an AdaptrisMessage
into a standard Message
; you
should choose an implementation of MessageTypeTranslator
. The more common types are
BytesMessageTranslator
, TextMessageTranslator
, ObjectMessageTranslator
and MapMessageTranslator
which correspond to BytesMessage
,
TextMessage
, ObjectMessage
and MapMessage
respectively. Each MessageTypeTranslator
will allow you to move some or all metadata from
the AdaptrisMessage to the JMS Message. Of course, there are other vendor specific JMS message
types can be used.
The Message.getJMSCorrelationID()
field is generally used for linking one
message to with another. It typically links a reply message with the originating request message.
If you need to handle the correlation id in some fashion then typically you would choose an
implementation of CorrelationIdSource
that explicitly handles the correlation ID; for
instance MetadataCorrelationIdSource
.
Synchronous request/reply messaging behaviour is available for this producer and relies heavily
on the Message.getJMSReplyTo()
field. Normally if the adapter is initiating the
request then a temporary destination is created and this is used as the JMSReplyTo field.
Sometimes you may wish to specify your own JMSReplyTo field (where the JMS Vendor doesn't play
nice with temporary topics). To do this, then you need to ensure that the metadata key
"JMSAsyncStaticReplyTo" is set with the appropriate
queue name; this will cause that message to be produced to the topic with a JMSReplyTo set to
that topic name. You may also use
"JMSAsyncStaticReplyTo" in an asynchronous
workflow; if the metadata key exists in the message then it will be used to populate the
JMSReplyTo Field.
By convention, the Message.getJMSPriority()
,
Message.getJMSDeliveryMode()
, and Message.getJMSExpiration()
are configured directly (expiration here is semantically equivalent to the element
JmsProducerImpl.setTtl(Long)
on the producer. It is possible to control it dynamically on a per message
basis using the element JmsProducerImpl.setPerMessageProperties(Boolean)
. If you opt to control these
fields on a per message basis then the following metadata keys are used :
DeliveryMode
In the adapter configuration file this class is aliased as jms-topic-producer which is the preferred alternative to the fully qualified classname when building your configuration.
producerSession
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
PasProducer() |
PasProducer(ProduceDestination d) |
Modifier and Type | Method and Description |
---|---|
protected javax.jms.Topic |
createDestination(java.lang.String name) |
protected javax.jms.Destination |
createTemporaryDestination() |
doRequest, produce, produce
acknowledge, calculateDeliveryMode, calculatePriority, calculateTimeToLive, captureOutgoingMessageDetails, captureOutgoingMessageDetails, close, commit, configuredAcknowledgeMode, configuredCorrelationIdSource, configuredMessageListener, configuredMessageTranslator, createDestination, currentLogger, currentSession, defaultTimeout, getAcknowledgeMode, getCaptureOutgoingMessageDetails, getCorrelationIdSource, getDeliveryMode, getMessageTranslator, getPerMessageProperties, getPriority, getSessionFactory, getTtl, init, isManagedTransaction, logLinkedException, messagePriority, perMessageProperties, prepare, rollback, rollbackTimeout, setAcknowledgeMode, setCaptureOutgoingMessageDetails, setCorrelationIdSource, setDeliveryMode, setMessageTranslator, setPerMessageProperties, setPriority, setSessionFactory, setTtl, setupSession, start, stop, timeToLive, translate
getIgnoreReplyMetadata, produce, request, request, request, request, setIgnoreReplyMetadata, shouldIgnoreReplyMetadata
getDestination, setDestination
createName, createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
getUniqueId
createName, createQualifier, isTrackingEndpoint
public PasProducer()
public PasProducer(ProduceDestination d)
protected javax.jms.Topic createDestination(java.lang.String name) throws javax.jms.JMSException
createDestination
in class DefinedJmsProducer
javax.jms.JMSException
protected javax.jms.Destination createTemporaryDestination() throws javax.jms.JMSException
createTemporaryDestination
in class DefinedJmsProducer
javax.jms.JMSException