Class JmsProducerImpl

    • Constructor Detail

      • JmsProducerImpl

        public JmsProducerImpl()
    • Method Detail

      • stop

        public void stop()
        Description copied from interface: ComponentLifecycle
        Stop the component

        A stopped component is not expected to be ready to process messages. In the case of AdaptrisMessageConsumer, calling stop will pause message delivery. Throwing a RuntimeException may cause unintended consequences

        Specified by:
        stop in interface ComponentLifecycle
      • close

        public void close()
        Description copied from interface: ComponentLifecycle
        Closes the component.

        A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException may cause unintended consequences

        Specified by:
        close in interface ComponentLifecycle
      • logLinkedException

        protected void logLinkedException​(java.lang.String prefix,
                                          java.lang.Exception e)
      • calculateDeliveryMode

        protected int calculateDeliveryMode​(AdaptrisMessage msg,
                                            java.lang.String defaultDeliveryMode)
      • calculateTimeToLive

        protected long calculateTimeToLive​(AdaptrisMessage msg,
                                           java.lang.Long defaultTTL)
                                    throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • translate

        protected javax.jms.Message translate​(AdaptrisMessage msg,
                                              javax.jms.Destination replyTo)
                                       throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • calculatePriority

        protected int calculatePriority​(AdaptrisMessage msg,
                                        java.lang.Integer defaultPriority)
      • getDeliveryMode

        public java.lang.String getDeliveryMode()

        Returns the JMS delivery mode.

        Returns:
        the JMS delivery mode
      • setDeliveryMode

        public void setDeliveryMode​(java.lang.String i)

        Sets the JMS delivery mode.

        The value may be either "PERSISENT", "NON_PERSISTENT", or the int corresponding to the javax.jms.DeliveryMode constant.

        Parameters:
        i - the JMS delivery mode
      • getPriority

        public java.lang.Integer getPriority()

        Returns the JMS priority.

        Returns:
        the JMS priority
      • setPriority

        public void setPriority​(java.lang.Integer i)

        Sets the JMS priority. Valid values are 0 to 9.

        Parameters:
        i - the JMS priority
      • messagePriority

        public int messagePriority()
      • getTtl

        public java.lang.Long getTtl()

        Returns the time to live. 0 means live forever.

        Returns:
        the time to live
      • timeToLive

        public long timeToLive()
      • setTtl

        public void setTtl​(java.lang.Long l)

        Sets the time to live.

        Parameters:
        l - the time to live
      • setMessageTranslator

        public void setMessageTranslator​(MessageTypeTranslator translator)

        Sets the MessageTypeTranslator to use.

        Parameters:
        translator - the MessageTypeTranslator to use
      • getMessageTranslator

        public MessageTypeTranslator getMessageTranslator()

        Returns the MessageTypeTranslator to use.

        Returns:
        the MessageTypeTranslator to use
      • setAcknowledgeMode

        public void setAcknowledgeMode​(java.lang.String s)

        Sets the JMS acknowledge mode.

        The value may be AUTO_KNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE or the int values corresponding to the JMS Session Constant

      • getAcknowledgeMode

        public java.lang.String getAcknowledgeMode()

        Returns the JMS acknowledge mode.

        Returns:
        the JMS acknowledge mode
      • getCorrelationIdSource

        public CorrelationIdSource getCorrelationIdSource()

        Returns correlationIdSource.

        Returns:
        correlationIdSource
      • setCorrelationIdSource

        public void setCorrelationIdSource​(CorrelationIdSource c)

        Sets correlationIdSource.

        Parameters:
        c - the correlationIdSource to set
      • getPerMessageProperties

        public java.lang.Boolean getPerMessageProperties()
        Returns:
        the perMessageProperties
      • setPerMessageProperties

        public void setPerMessageProperties​(java.lang.Boolean b)
        Specify message properties per message rather than per producer.

        If set to true, then each message that is produced can have its own individual time-to-live, priority and delivery mode. These properties are taken from the producer's configuration but can be overriden via metadata.

        Parameters:
        b - the perMessageProperties to set
        See Also:
        JmsConstants.JMS_PRIORITY, JmsConstants.JMS_DELIVERY_MODE, JmsConstants.JMS_EXPIRATION
      • perMessageProperties

        public boolean perMessageProperties()
      • commit

        public void commit()
                    throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • rollback

        public void rollback()
      • acknowledge

        protected void acknowledge​(javax.jms.Message msg)
                            throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • configuredAcknowledgeMode

        public int configuredAcknowledgeMode()
        Description copied from interface: JmsActorConfig
        Return the current acknowledge mode.
        Specified by:
        configuredAcknowledgeMode in interface JmsActorConfig
        Returns:
        the session acknowledge mode.
      • currentSession

        public javax.jms.Session currentSession()
        Description copied from interface: JmsActorConfig
        Return the current jms session.
        Specified by:
        currentSession in interface JmsActorConfig
        Returns:
        the current javax.jms.Session
      • currentLogger

        public org.slf4j.Logger currentLogger()
        Description copied from interface: JmsActorConfig
        Return the configured logger.
        Specified by:
        currentLogger in interface JmsActorConfig
        Returns:
        the logger.
      • transactedSession

        public boolean transactedSession()
      • rollbackTimeout

        public long rollbackTimeout()
        Description copied from interface: JmsActorConfig
        How long we should wait after a rollback before continuing on with processing
        Specified by:
        rollbackTimeout in interface JmsActorConfig
        Returns:
        the timeout in ms.
      • isManagedTransaction

        public boolean isManagedTransaction()
        Specified by:
        isManagedTransaction in interface JmsActorConfig
        Returns:
        whether we are in a managed (XA) transaction
      • captureOutgoingMessageDetails

        protected boolean captureOutgoingMessageDetails()
      • getCaptureOutgoingMessageDetails

        public java.lang.Boolean getCaptureOutgoingMessageDetails()
      • setCaptureOutgoingMessageDetails

        public void setCaptureOutgoingMessageDetails​(java.lang.Boolean b)
        Specify whether or not to capture the outgoing message details as object metadata.

        Some JMS providers may not make information such as Message.getJMSMessageID() available until the message is accepted for delivery by the provider. Set this to be true, if you need to make use of that information later on in the workflow. All information captured is stored against the object metadata key "javax.jms.Message.{propertyName}" e.g. "javax.jms.Message.JMSMessageID" where JMSMessageID is derived from the associated JmsConstants constant.

        Parameters:
        b - true to capture standard JMS Headers as object metadata post produce. If unspecified, defaults to false.
      • captureOutgoingMessageDetails

        protected void captureOutgoingMessageDetails​(javax.jms.Message jmsMsg,
                                                     AdaptrisMessage msg)