17#ifndef _ACTIVEMQ_CORE_KERNELS_ACTIVEMQCONSUMERKERNEL_H_
18#define _ACTIVEMQ_CORE_KERNELS_ACTIVEMQCONSUMERKERNEL_H_
43 using decaf::lang::Pointer;
44 using decaf::util::concurrent::atomic::AtomicBoolean;
47 class ActiveMQConsumerKernelConfig;
55 ActiveMQConsumerKernelConfig* internal;
69 ActiveMQConsumerKernel(
const ActiveMQConsumerKernel&);
70 ActiveMQConsumerKernel& operator=(
const ActiveMQConsumerKernel&);
77 const std::string& name,
78 const std::string& selector,
80 int maxPendingMessageCount,
419 void sendPullRequest(
long long timeout);
421 void checkClosed()
const;
423 void checkMessageListener()
const;
431 bool isAutoAcknowledgeEach()
const;
433 bool isAutoAcknowledgeBatch()
const;
437 void clearDeliveredList();
#define AMQCPP_API
Definition Config.h:30
Interface for an object responsible for dispatching messages to consumers.
Definition Dispatcher.h:32
Interface for a RedeliveryPolicy object that controls how message Redelivery is handled in ActiveMQ-C...
Definition RedeliveryPolicy.h:34
bool isSynchronizationRegistered() const
Has this Consumer Transaction Synchronization been added to the transaction.
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.
virtual cms::Message * receive(int millisecs)
Synchronously Receive a Message, time out after defined interval.
bool iterate()
Deliver any pending messages to the registered MessageListener if there is one, return true if not al...
bool isConsumerExpiryCheckEnabled()
bool isInUse(Pointer< commands::ActiveMQDestination > destination) const
Checks if the given destination is the Destination that this Consumer is subscribed to.
virtual std::string getMessageSelector() const
Gets this message consumer's message selector expression.
void dispose()
Cleans up this objects internal resources.
virtual void setMessageTransformer(cms::MessageTransformer *transformer)
Set an MessageTransformer instance that is applied to all cms::Message objects before they are dispat...
virtual cms::MessageListener * getMessageListener() const
Gets the MessageListener that this class will send mew Message notification events to.
bool isTransactedIndividualAck() const
Will Message's in a transaction be acknowledged using the Individual Acknowledge mode.
long long setFailoverRedeliveryWaitPeriod() const
Returns the delay after a failover before Message redelivery starts.
void commit()
Called to Commit the current set of messages in this Transaction.
virtual ~ActiveMQConsumerKernel()
void setOptimizedAckScheduledAckInterval(long long value)
Sets the time in Milliseconds to schedule an automatic acknowledge of outstanding messages when optim...
virtual void setMessageAvailableListener(cms::MessageAvailableListener *listener)
Sets the MessageAvailableListener that this class will send events to if the consumer is in synchrono...
virtual void setMessageListener(cms::MessageListener *listener)
Sets the MessageListener that this class will send notifs on.
virtual cms::MessageTransformer * getMessageTransformer() const
Gets the currently configured MessageTransformer for this MessageConsumer.
void setFailoverRedeliveryWaitPeriod(long long value)
Sets the time in milliseconds to delay after failover before starting message redelivery.
void doClose()
Performs the actual close operation on this consumer.
virtual int getHashCode() const
HashCode method allowing Dispatcher instances to be used in HashMap etc.
const Pointer< commands::ConsumerInfo > & getConsumerInfo() const
Get the Consumer information for this consumer.
void afterMessageIsConsumed(Pointer< commands::MessageDispatch > dispatch, bool messageExpired)
Post-consume processing.
virtual cms::Message * receive()
Synchronously Receive a Message.
void setPrefetchSize(int prefetchSize)
Sets the current prefetch size for the consumer as indicated by a Broker ConsumerControl command.
void setOptimizeAcknowledge(bool value)
Enable or disable optimized acknowledge for this consumer.
void setConsumerExpiryCheckEnabled(bool consumerExpiryCheckEnabled)
Configures whether this consumer will perform message expiration processing on all incoming messages.
virtual cms::Message * receiveNoWait()
Receive a Message, does not wait if there isn't a new message to read, returns NULL if nothing read.
bool isRedeliveryExpectedInCurrentTransaction(Pointer< commands::MessageDispatch > dispatch) const
Returns true if the given MessageDispatch is expected to be redelivered in the currently open transac...
void setRedeliveryPolicy(RedeliveryPolicy *policy)
Sets the RedeliveryPolicy this Consumer should use when a rollback is performed on a transacted Consu...
RedeliveryPolicy * getRedeliveryPolicy() const
Gets a pointer to this Consumer's Redelivery Policy object, the Consumer retains ownership of this po...
void acknowledge(Pointer< commands::MessageDispatch > dispatch)
Method called to acknowledge the Message contained in the given MessageDispatch.
bool isOptimizeAcknowledge() const
void acknowledge()
Method called to acknowledge all messages that have been received so far.
void setFailureError(decaf::lang::Exception *error)
Sets the Exception that has caused this Consumer to be in a failed state.
void deliverAcks()
Forces this consumer to send all pending acks to the broker.
void acknowledge(Pointer< commands::MessageDispatch > dispatch, int ackType)
Method called to acknowledge the Message contained in the given MessageDispatch.
virtual cms::MessageAvailableListener * getMessageAvailableListener() const
Gets the MessageAvailableListener that this class will send mew Message notification events to.
const Pointer< commands::ConsumerId > & getConsumerId() const
Get the Consumer Id for this consumer.
void clearMessagesInProgress()
Called on a Failover to clear any pending messages.
void setLastDeliveredSequenceId(long long value)
Sets the value of the Last Delivered Sequence Id.
void setSynchronizationRegistered(bool value)
Sets the Synchronization Registered state of this consumer.
void rollback()
Called to Roll back the current set of messages in this Transaction.
virtual void start()
Starts the service.
long long getOptimizedAckScheduledAckInterval() const
Time in Milliseconds before an automatic acknowledge is done for any outstanding delivered Messages.
void setTransactedIndividualAck(bool value)
Set if Message's in a transaction be acknowledged using the Individual Acknowledge mode.
long long getLastDeliveredSequenceId() const
Gets the currently set Last Delivered Sequence Id.
virtual void close()
Closes this object and deallocates the appropriate resources.
ActiveMQConsumerKernel(ActiveMQSessionKernel *session, const Pointer< commands::ConsumerId > &id, const Pointer< commands::ActiveMQDestination > &destination, const std::string &name, const std::string &selector, int prefetch, int maxPendingMessageCount, bool noLocal, bool browser, bool dispatchAsync, cms::MessageListener *listener)
Pointer< MessageDispatch > dequeue(long long timeout)
Used by synchronous receive methods to wait for messages to come in.
virtual void stop()
Stops this service.
void inProgressClearRequired()
Signals that a Failure occurred and that anything in-progress in the consumer should be cleared.
void beforeMessageIsConsumed(Pointer< commands::MessageDispatch > dispatch)
Pre-consume processing.
int getMessageAvailableCount() const
virtual void dispatch(const Pointer< MessageDispatch > &message)
Dispatches a message to a particular consumer.
Definition ActiveMQSessionKernel.h:67
A listener interface similar to the MessageListener interface.
Definition MessageAvailableListener.h:33
A client uses a MessageConsumer to received messages from a destination.
Definition MessageConsumer.h:63
Root of all messages.
Definition Message.h:88
A MessageListener object is used to receive asynchronously delivered messages.
Definition MessageListener.h:33
Definition Exception.h:38
Decaf's implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition Pointer.h:53
Definition ActiveMQQueueBrowser.h:37
Definition ActiveMQTempDestination.h:29
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition CachedConsumer.h:24