Yes I agree it should be replicating, the problem is that it isn't. I must be
doing something wrong, but for the life of me I can't see what it is. I've
gone through all of the tutorials and reference pages, and my configuration
seems correct. The synchronous replication of the cached objects in the
TreeCacheAop just doesn't happen as advertised. When a new object is added to
the TreeCacheAop it's correctly replicated into the other TreeCacheAops on all
nodes of the cluster, but any subsequent modifications of the cached objects
are not replicated, and everything quickly becomes out of sync.
Below is a summary of my configuration and code, hopefully someone can see
where I'm going awry:
The class which uses the TreeCacheAop is UserActivityManager, which is a Simple
MBean. This class has methods which are invoked by Servlets and other MBeans
to update UserActivity JavaBean objects which are being cached. As mentioned
in the original post these objects are being aspectized by virtue of the
entry in jboss-aop.xml. The jboss-service.xml included in my SAR is as follows:
?xml version=1.0 encoding=UTF-8?
|
| server
|
| mbean code=org.jboss.cache.aop.TreeCacheAop
|name=jboss.cache:service=TreeCacheAop
| dependsjboss:service=Naming/depends
| dependsjboss:service=TransactionManager/depends
| attribute
name=TransactionManagerLookupClassorg.jboss.cache.JBossTransactionManagerLookup/attribute
| attribute name=IsolationLevelREPEATABLE_READ/attribute
| attribute name=CacheModeREPL_SYNC/attribute
| attribute name=UseReplQueuefalse/attribute
| attribute name=ReplQueueInterval0/attribute
| attribute name=ReplQueueMaxElements0/attribute
| attribute name=ClusterNameTreeCache-Cluster/attribute
| attribute name=ClusterConfig
| config
| UDP mcast_addr=228.1.2.83
| mcast_port=45556
| ip_ttl=64
| ip_mcast=true
| mcast_send_buf_size=15
| mcast_recv_buf_size=8
| ucast_send_buf_size=15
| ucast_recv_buf_size=8
| loopback=false/
| PING timeout=2000
| num_initial_members=3
| up_thread=false
| down_thread=false/
| MERGE2 min_interval=1
| max_interval=2/
| FD_SOCK/
| VERIFY_SUSPECT timeout=1500
| up_thread=false
| down_thread=false/
| pbcast.NAKACK gc_lag=50
|retransmit_timeout=600,1200,2400,4800
|up_thread=false
|down_thread=false/
| pbcast.STABLE desired_avg_gossip=2
|up_thread=false
|down_thread=false/
| UNICAST timeout=600,1200,2400
| window_size=100
| min_threshold=10
| down_thread=false/
| FRAG frag_size=8192
| down_thread=false
| up_thread=false/
| pbcast.GMS join_timeout=5000
| join_retry_timeout=2000
| shun=true
| print_local_addr=true/
| pbcast.STATE_TRANSFER up_thread=true
|down_thread=true/
| /config
| /attribute
| attribute name=FetchStateOnStartuptrue/attribute
| attribute name=InitialStateRetrievalTimeout15000/attribute
| attribute name=SyncReplTimeout1/attribute
| attribute name=LockAcquisitionTimeout3/attribute
| attribute name=EvictionPolicyClass/attribute
| /mbean
|
| mbean code=com.mycom.grover.mbean.UserActivityManager
|name=grover.management:service=UserActivityManager
| dependsjboss.cache:service=TreeCacheAop/depends
| /mbean
|
| /server
A typical method of the UserActivityManager MBean which accesses the cached
UserActivity objects and updates a couple of Date properties:
/**
| * Updates the user activity information for the specified user to
indicate the last time
| * the user accessed the system (heartbeat) and the last time the user
sent an IOI message.
| *
| * @param userId the user's ID
| * @throws MBeanException
| */
| public void updateMessageSentTime (String userId)
| throws MBeanException
| {
| // handle a null/blank parameter
| if