org.activemq.service.impl
Class InitialImageMessageContainerManager
java.lang.Object
org.activemq.service.impl.ProxyMessageContainerManager
org.activemq.service.impl.InitialImageMessageContainerManager
- All Implemented Interfaces:
- MessageContainerManager, Service
public class InitialImageMessageContainerManager
- extends ProxyMessageContainerManager
Implements an initial image service where on subscription
the client will receive the last image that was previously cached.
This is very useful in financial market data and in rapidly changing
transient event models where you don't want to persist messages
when you are away, but wish to cache the last image, per destination
around so that when a new reliable consumer subscribes you receive the
latest value you may have missed.
This is especially true in finance with slow moving markets where you may
have to wait a while for an update (or times when you subscribe after
market close etc).
- Version:
- $Revision: 1.1.1.1 $
Methods inherited from class org.activemq.service.impl.ProxyMessageContainerManager |
acknowledgeMessage, createMessageContainer, deleteSubscription, destroyMessageContainer, getContainer, getDeadLetterPolicy, getDelegate, getDestinations, getLocalDestinations, getMessageContainerAdmins, poll, removeMessageConsumer, setDeadLetterPolicy, setDelegate, start, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InitialImageMessageContainerManager
public InitialImageMessageContainerManager(MessageContainerManager delegate,
Map cache,
DestinationFilter destinationFilter)
- Creates a topic based initial image message container manager using the given destination filter
- Parameters:
delegate
- cache
- destinationFilter
-
InitialImageMessageContainerManager
public InitialImageMessageContainerManager(MessageContainerManager delegate,
Map cache,
boolean topic,
DestinationFilter destinationFilter)
addMessageConsumer
public void addMessageConsumer(BrokerClient client,
ConsumerInfo info)
throws JMSException
- Specified by:
addMessageConsumer
in interface MessageContainerManager
- Overrides:
addMessageConsumer
in class ProxyMessageContainerManager
- Throws:
JMSException
sendMessage
public void sendMessage(BrokerClient client,
ActiveMQMessage message)
throws JMSException
- Specified by:
sendMessage
in interface MessageContainerManager
- Overrides:
sendMessage
in class ProxyMessageContainerManager
- Throws:
JMSException
sendMatchingInitialImages
protected void sendMatchingInitialImages(BrokerClient client,
ConsumerInfo info,
DestinationFilter filter)
throws JMSException
- Throws:
JMSException
isValid
protected boolean isValid(ActiveMQDestination destination)
- Does this message match the destinations on which initial image caching should be used
- Parameters:
destination
-
- Returns:
- true if the given destination should use initial image caching
which is typically true if the message is a topic which may match
an optional DestinationFilter
Copyright © 2004-2009 Protique, Ltd.. All Rights Reserved.