@ComponentProfile(summary="Place message on a JMS queue or topic asynchronously", tag="producer,jms", recommended=JmsConnection.class) public class JmsAsyncProducer extends JmsProducer
JmsProducer
, but allows us to send messages asynchronously.
Essentially the producer sending the message to the JMS provider will not wait for a response that would normally confirm the message
has been received and persisted. Instead the producer sends the JMS message in a "fire-and-forget" manner.
At some future point in time, the JMS provider will call us back with confirmation or inform us of an error for each sent message.
One of the benefits to sending messages asynchronously simply comes down to processing speed. During any producer, it is generally the time waiting for the JMS provider to return control back to the client after the client submits a message that takes the most time. With asynchronous message producing, we no longer have to wait for the JMS provider, allowing us to move onto the next message.
In the adapter configuration file this class is aliased as jms-async-producer which is the preferred alternative to the fully qualified classname when building your configuration.
JmsProducer.MyJmsDestination
log
Constructor and Description |
---|
JmsAsyncProducer() |
Modifier and Type | Method and Description |
---|---|
JmsAsyncProducerEventHandler |
getEventHandler() |
void |
init()
Initialises the component.
|
protected void |
produce(AdaptrisMessage msg,
JmsDestination jmsDest) |
void |
setEventHandler(JmsAsyncProducerEventHandler eventHandler) |
buildDestination, createReplyTo, endpoint, getDestination, getEndpoint, perMessageProperties, prepare, produce, produce, request, request, setDestination, setEndpoint, vendorImplementation, waitForReply, withEndpoint
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, isManagedTransaction, logLinkedException, messagePriority, producerSession, request, request, rollback, rollbackTimeout, setAcknowledgeMode, setCaptureOutgoingMessageDetails, setCorrelationIdSource, setDeliveryMode, setMessageTranslator, setPerMessageProperties, setPriority, setSessionFactory, setTtl, setupSession, start, stop, timeToLive, transactedSession, translate
copyReplyContents, getIgnoreReplyMetadata, mergeReply, setIgnoreReplyMetadata
createName
createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory, withUniqueID
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
getUniqueId
createQualifier, isTrackingEndpoint
protected void produce(AdaptrisMessage msg, JmsDestination jmsDest) throws javax.jms.JMSException, CoreException
produce
in class JmsProducer
javax.jms.JMSException
CoreException
public void init() throws CoreException
ComponentLifecycle
Component initialisation includes config verification, creation of connections etc.
init
in interface ComponentLifecycle
init
in class JmsProducerImpl
CoreException
- wrapping any underlying Exception
spublic JmsAsyncProducerEventHandler getEventHandler()
public void setEventHandler(JmsAsyncProducerEventHandler eventHandler)