activemq-cpp-3.9.0
|
#include <src/main/activemq/core/ActiveMQConsumer.h>
Public Member Functions | |
ActiveMQConsumer (const Pointer< activemq::core::kernels::ActiveMQConsumerKernel > &kernel) | |
Create a new ActiveMQConsumer that contains the pointer to the Kernel that implement the real MessageConsumer functionality. More... | |
virtual | ~ActiveMQConsumer () |
virtual void | start () |
Starts the service. More... | |
virtual void | stop () |
Stops this service. More... | |
virtual void | close () |
Closes this object and deallocates the appropriate resources. More... | |
virtual cms::Message * | receive () |
Synchronously Receive a Message. More... | |
virtual cms::Message * | receive (int millisecs) |
Synchronously Receive a Message, time out after defined interval. More... | |
virtual cms::Message * | receiveNoWait () |
Receive a Message, does not wait if there isn't a new message to read, returns NULL if nothing read. More... | |
virtual void | setMessageListener (cms::MessageListener *listener) |
Sets the MessageListener that this class will send notifs on. More... | |
virtual cms::MessageListener * | getMessageListener () const |
Gets the MessageListener that this class will send mew Message notification events to. More... | |
virtual void | setMessageAvailableListener (cms::MessageAvailableListener *listener) |
Sets the MessageAvailableListener that this class will send events to if the consumer is in synchronous consumption mode and a new Message has arrived. More... | |
virtual cms::MessageAvailableListener * | getMessageAvailableListener () const |
Gets the MessageAvailableListener that this class will send mew Message notification events to. More... | |
virtual std::string | getMessageSelector () const |
Gets this message consumer's message selector expression. More... | |
virtual void | setMessageTransformer (cms::MessageTransformer *transformer) |
Set an MessageTransformer instance that is applied to all cms::Message objects before they are dispatched to client code. More... | |
virtual cms::MessageTransformer * | getMessageTransformer () const |
Gets the currently configured MessageTransformer for this MessageConsumer. More... | |
const Pointer < commands::ConsumerInfo > & | getConsumerInfo () const |
Get the Consumer information for this consumer. More... | |
const Pointer < commands::ConsumerId > & | getConsumerId () const |
Get the Consumer Id for this consumer. More... | |
bool | isClosed () const |
int | getMessageAvailableCount () const |
void | setRedeliveryPolicy (RedeliveryPolicy *policy) |
Sets the RedeliveryPolicy this Consumer should use when a rollback is performed on a transacted Consumer. More... | |
RedeliveryPolicy * | getRedeliveryPolicy () const |
Gets a pointer to this Consumer's Redelivery Policy object, the Consumer retains ownership of this pointer so the caller should not delete it. More... | |
decaf::lang::Exception * | getFailureError () const |
Gets the error that caused this Consumer to be in a Failed state, or NULL if there is no Error. More... | |
long long | getOptimizedAckScheduledAckInterval () const |
Time in Milliseconds before an automatic acknowledge is done for any outstanding delivered Messages. More... | |
void | setOptimizedAckScheduledAckInterval (long long value) |
Sets the time in Milliseconds to schedule an automatic acknowledge of outstanding messages when optimize acknowledge is enabled. More... | |
bool | isOptimizeAcknowledge () const |
void | setOptimizeAcknowledge (bool value) |
Enable or disable optimized acknowledge for this consumer. More... | |
![]() | |
virtual | ~Closeable () |
![]() | |
virtual | ~Startable () |
![]() | |
virtual | ~Stoppable () |
activemq::core::ActiveMQConsumer::ActiveMQConsumer | ( | const Pointer< activemq::core::kernels::ActiveMQConsumerKernel > & | kernel | ) |
Create a new ActiveMQConsumer that contains the pointer to the Kernel that implement the real MessageConsumer functionality.
ActiveMQConsumerKernel | This Consumer's functionality kernel. |
|
virtual |
|
virtual |
Closes this object and deallocates the appropriate resources.
The object is generally no longer usable after calling close.
CMSException | - If an error occurs while the resource is being closed. |
Implements cms::Closeable.
const Pointer<commands::ConsumerId>& activemq::core::ActiveMQConsumer::getConsumerId | ( | ) | const |
Get the Consumer Id for this consumer.
const Pointer<commands::ConsumerInfo>& activemq::core::ActiveMQConsumer::getConsumerInfo | ( | ) | const |
Get the Consumer information for this consumer.
decaf::lang::Exception* activemq::core::ActiveMQConsumer::getFailureError | ( | ) | const |
Gets the error that caused this Consumer to be in a Failed state, or NULL if there is no Error.
int activemq::core::ActiveMQConsumer::getMessageAvailableCount | ( | ) | const |
|
virtual |
Gets the MessageAvailableListener that this class will send mew Message notification events to.
CMSException | - If an internal error occurs. |
Implements cms::MessageConsumer.
|
virtual |
Gets the MessageListener that this class will send mew Message notification events to.
CMSException | - If an internal error occurs. |
Implements cms::MessageConsumer.
|
virtual |
Gets this message consumer's message selector expression.
CMSException | - If an internal error occurs. |
Implements cms::MessageConsumer.
|
virtual |
Gets the currently configured MessageTransformer for this MessageConsumer.
Implements cms::MessageConsumer.
long long activemq::core::ActiveMQConsumer::getOptimizedAckScheduledAckInterval | ( | ) | const |
Time in Milliseconds before an automatic acknowledge is done for any outstanding delivered Messages.
A value less than one means no task is scheduled.
RedeliveryPolicy* activemq::core::ActiveMQConsumer::getRedeliveryPolicy | ( | ) | const |
Gets a pointer to this Consumer's Redelivery Policy object, the Consumer retains ownership of this pointer so the caller should not delete it.
bool activemq::core::ActiveMQConsumer::isClosed | ( | ) | const |
bool activemq::core::ActiveMQConsumer::isOptimizeAcknowledge | ( | ) | const |
|
virtual |
Synchronously Receive a Message.
CMSException | - If an internal error occurs. |
Implements cms::MessageConsumer.
|
virtual |
Synchronously Receive a Message, time out after defined interval.
Returns null if nothing read.
CMSException | - If an internal error occurs. |
Implements cms::MessageConsumer.
|
virtual |
Receive a Message, does not wait if there isn't a new message to read, returns NULL if nothing read.
CMSException | - If an internal error occurs. |
Implements cms::MessageConsumer.
|
virtual |
Sets the MessageAvailableListener that this class will send events to if the consumer is in synchronous consumption mode and a new Message has arrived.
listener | The listener of new message events fired by this consumer. |
CMSException | - If an internal error occurs. |
Implements cms::MessageConsumer.
|
virtual |
Sets the MessageListener that this class will send notifs on.
listener | The listener of messages received by this consumer. |
CMSException | - If an internal error occurs. |
Implements cms::MessageConsumer.
|
virtual |
Set an MessageTransformer instance that is applied to all cms::Message objects before they are dispatched to client code.
The CMS code never takes ownership of the MessageTransformer pointer which implies that the client code must ensure that the object remains valid for the lifetime of the CMS object to which the MessageTransformer has been assigned.
transformer | Pointer to the cms::MessageTransformer to apply on each cms:;Message dispatch. |
Implements cms::MessageConsumer.
void activemq::core::ActiveMQConsumer::setOptimizeAcknowledge | ( | bool | value | ) |
Enable or disable optimized acknowledge for this consumer.
value | True if optimize acknowledge is enabled, false otherwise. |
void activemq::core::ActiveMQConsumer::setOptimizedAckScheduledAckInterval | ( | long long | value | ) |
Sets the time in Milliseconds to schedule an automatic acknowledge of outstanding messages when optimize acknowledge is enabled.
A value less than one means disable any scheduled tasks.
value | The time interval to send scheduled acks. |
void activemq::core::ActiveMQConsumer::setRedeliveryPolicy | ( | RedeliveryPolicy * | policy | ) |
Sets the RedeliveryPolicy this Consumer should use when a rollback is performed on a transacted Consumer.
The Consumer takes ownership of the passed pointer. The Consumer's redelivery policy can never be null, a call to this method with a NULL pointer is ignored.
policy | Pointer to a Redelivery Policy object that his Consumer will use. |
|
virtual |
Starts the service.
CMSException | if an internal error occurs while starting. |
Implements cms::Startable.
|
virtual |
Stops this service.
CMSException | - if an internal error occurs while stopping the Service. |
Implements cms::Stoppable.