Class JmsConsumerImpl

    • Field Detail

      • consumer

        protected transient javax.jms.MessageConsumer consumer
    • Constructor Detail

      • JmsConsumerImpl

        public JmsConsumerImpl()

        Creates a new instance. Default session type is client acknowledge, default JMS message type is text.

    • Method Detail

      • onMessage

        public void onMessage​(javax.jms.Message msg)

        Called by the JMS Session to deliver messages.

        Specified by:
        onMessage in interface javax.jms.MessageListener
        Parameters:
        msg - a javax.jms.Message
      • configuredEndpoint

        protected abstract java.lang.String configuredEndpoint()
      • createConsumer

        protected abstract javax.jms.MessageConsumer createConsumer()
                                                             throws javax.jms.JMSException,
                                                                    CoreException
        Throws:
        javax.jms.JMSException
        CoreException
      • 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
      • 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.
      • 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 i)

        Sets the JMS acknowledge mode to use.

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

        Parameters:
        i - the JMS acknowledge mode to use
      • getAcknowledgeMode

        public java.lang.String getAcknowledgeMode()

        Returns the JMS acknowledge mode to use.

        Returns:
        the JMS acknowledge mode to use
      • getCorrelationIdSource

        public CorrelationIdSource getCorrelationIdSource()

        Returns correlationIdSource.

        Returns:
        correlationIdSource
      • setCorrelationIdSource

        public void setCorrelationIdSource​(CorrelationIdSource c)

        Sets correlationIdSource.

        Parameters:
        c - the correlationIdSource to set
      • 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.
      • setManagedTransaction

        public void setManagedTransaction​(boolean managedTransaction)
      • isManagedTransaction

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

        public java.lang.String getMessageSelector()
        The message selector to use when matching messages to consume
      • setMessageSelector

        public void setMessageSelector​(java.lang.String messageSelector)
        The message selector to use when matching messages to consume