Class BaseJmsPollingConsumerImpl

    • Constructor Detail

      • BaseJmsPollingConsumerImpl

        public BaseJmsPollingConsumerImpl()
    • Method Detail

      • initConsumer

        protected void initConsumer()
                             throws javax.jms.JMSException,
                                    CoreException
        Throws:
        javax.jms.JMSException
        CoreException
      • createConsumer

        protected abstract javax.jms.MessageConsumer createConsumer()
                                                             throws javax.jms.JMSException,
                                                                    CoreException
        Throws:
        javax.jms.JMSException
        CoreException
      • messageConsumer

        public javax.jms.MessageConsumer messageConsumer()
      • closeMessageConsumer

        protected void closeMessageConsumer()
      • doProcessMessage

        protected int doProcessMessage()
      • 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.
      • 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.
      • initSession

        protected void initSession()
                            throws javax.jms.JMSException,
                                   CoreException
        Throws:
        javax.jms.JMSException
        CoreException
      • createSession

        protected abstract javax.jms.Session createSession​(int acknowledgeMode,
                                                           boolean transacted)
                                                    throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • 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
      • closeSession

        protected void closeSession()
      • 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
      • getAcknowledgeMode

        public java.lang.String getAcknowledgeMode()
        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. If not set explicitly then defaults to CLIENT_ACKNOWLEDGE.

      • setAcknowledgeMode

        public void setAcknowledgeMode​(java.lang.String acknowledgeMode)
        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. If not set explicitly then defaults to CLIENT_ACKNOWLEDGE.

      • getMessageTranslator

        @NonNull
        public @NonNull MessageTypeTranslator getMessageTranslator()
        Sets the MessageTypeTranslator to use.

        If not configured explicitly then defaults to AutoConvertMessageTranslator which attempts to do the right thing

      • setMessageTranslator

        public void setMessageTranslator​(@NonNull
                                         @NonNull MessageTypeTranslator messageTranslator)
        Sets the MessageTypeTranslator to use.

        If not configured explicitly then defaults to AutoConvertMessageTranslator which attempts to do the right thing

      • getReceiveTimeout

        public TimeInterval getReceiveTimeout()
        Sets the period that this class should wait for the broker to deliver a message.

        The default value of 2 seconds should be suitable in most situations. If there is a high degree of network latency and this class does not consume messages from Queues / Topics as expected try setting a higher value.

      • setReceiveTimeout

        public void setReceiveTimeout​(TimeInterval receiveTimeout)
        Sets the period that this class should wait for the broker to deliver a message.

        The default value of 2 seconds should be suitable in most situations. If there is a high degree of network latency and this class does not consume messages from Queues / Topics as expected try setting a higher value.

      • getMessageSelector

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

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