Class JmsAsyncProducer

  • All Implemented Interfaces:
    AdaptrisComponent, AdaptrisMessageProducer, AdaptrisMessageSender, AdaptrisMessageWorker, ComponentLifecycle, ComponentLifecycleExtension, JmsActorConfig, MessageEventGenerator

    @ComponentProfile(summary="Place message on a JMS queue or topic asynchronously",
                      tag="producer,jms",
                      recommended=JmsConnection.class)
    public class JmsAsyncProducer
    extends JmsProducer
    JMS 2.0 Producer implementation that extends all features of JmsProducer, but allows us to send messages asynchronously.
    Be aware, you must have a JMS 2.0 compatible broker, this producer is not backward compatible to JMS 1.1

    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.