Class PasProducer

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

    @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 :

    • "JMSPriority" - This overrides the priority of the message and should be an integer value.
    • "JMSDeliveryMode" - This overrides the delivery mode of the message, and can either be an integer or a string value understood by DeliveryMode
    • "JMSExpiration" - This overrides the expiration of the message, and can either be an long value specifying when the message expires, or a string value in the form "yyyy-MM-dd'T'HH:mm:ssZ". It will be used to calculate the correct TTL.

    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.