-
1. Re: How do I use Infinispan as a data grid?
mircea.markus Jun 6, 2011 10:49 AM (in response to cdman)1 of 1 people found this helpfulWill this work? Is it possible to interact with the cache (ie. to modify other objects) from an interceptor?
Should be, but the prefared way is through the Cache interface.
Which interceptor should I use? handlePutMapCommand and handleReplaceCommand from the PrePostProcessingCommandInterceptor (3) look promising
Look at an existing interceptor implementation, e.g. CacheMgmtInterceptor:http://bit.ly/mHQPfx.
Generally "handlePutMapCommand" is invoked on a cache.putAll(Map).
Is is possible to start a HotRod server programatically (ie from your code rather than from the shell script?) This would make debugging easier for me (and also conceptually I'm thinking of the application as a separate entity, not something hosted inside of a container)
Yes, take a look at a test in the HotrodClient test suite, e.g. http://bit.ly/kFBoqL
-
2. Re: How do I use Infinispan as a data grid?
cdman Jun 13, 2013 11:21 AM (in response to cdman)Hello,
Thank you for the feedback. It has been a long time coming, but finally I put together a concrete code example using some of techniques from above. You can read the article about it here: http://www.todaysoftmag.com/article/en/12/High_availability_performance_systems_using_data_grids_in_Java_437 and get the code here: https://github.com/cdman/infinispan-exchange
I would also like to thank Dan Berindei for his help.
Some updates:
- hotrod is not used because watching for elements would have needed implementing an interceptor (I understand from Dan that listeners are called before the element is actually committed and using them would have created the risk of double-processing). Instead I just created a REST endpoint
- also, hotrod doesn't support continious query, so there is no good solution for the output
- an other issue with HotRod (in my opinion) is that implementation of non-java clients seems to have stalled a little bit
- the transaction + failover support seems to have some bugs which Dan is (has?) ironed out
Unfortunately the performance I got out of the system (~1000 TPS) is too low for the kind of solution I was looking for (feel free to look at the code and suggest improvements, but the matching engine itself supports ~400k operations on the same system and a test with Radargun confirmed that this value is in the range of values to be expected).
Thank you,
Attila
-
3. Re: How do I use Infinispan as a data grid?
mircea.markus Jun 18, 2013 11:41 AM (in response to cdman)thanks for sharing Attila. I'll take a look.