GithubHelp home page GithubHelp logo

wfink / infinispanhotrodclient-playground-retrieveentrieswithfilter Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 14 KB

Examples how to use retrieveEntries with server side filtering for a HotRod client

License: Apache License 2.0

Java 100.00%

infinispanhotrodclient-playground-retrieveentrieswithfilter's Introduction

HotRod client: Use server side Filters to retrieve entries

HotRod client: Use server side Filters to retrieve entries

Author: Wolf-Dieter Fink Level: Advanced Technologies: Infinispan, Hot Rod

What is it?

Examples how to use retrieveEntries method for a HotRod remote client with server side filtering. A simple server side filter which filter all (String) keys from a cache by using a substrin pattern. A complex example which need to deploy the classes used inside of the cache and the filter will use criteria past by the client.

Hot Rod is a binary TCP client-server protocol. The Hot Rod protocol facilitates faster client and server interactions in comparison to other text based protocols and allows clients to make decisions about load balancing, failover and data location operations.

Prepare a server instance

Simple start a Infinispan or JDG server with the default configuration.

Build and Run the example

  1. Type this command to build and deploy the archive:

     mvn clean package
    
  2. Copy the necessary jar to the server and start the server

     cp domain/target/HotRodRetrieveWithFilter-domain.jar /path/to/server/standalone/deployments
     cp serverSide/target/HotRodRetrieveWithFilter-server.jar /path/to/server/standalone/deployments
     /path/to/server/bin/standalone.sh
    

    Consider the -domain.jar is only for the second example to provide the Custom key/Value classes It can be removed if this is not used together with the jboss-deployment-structure descriptor

  3. Use java command or an IDE to start one of the following standalone clients for demonstration

    RetrieveHotRodClient
      This example use a simple String key
      One example is a Hardcoded filter at server side.
      The other example use a filter that can set a substring from the client side
    
    RetrieveCustomObjectHotRodClient
      This example use more complicated filter parameter and also a custom class for the key/values within the cache.
      To get this working the classes need to be known for serialization, otherwise an Exception is thrown.
      The classes can be passed by the start command like this
    
           bin/standalone.sh -Dinfinispan.deserialization.whitelist.classes=org.infinispan.wfink.hotrod.batch.domain.MySpecialKey,org.infinispan.wfink.hotrod.batch.domain.MySpecialValue
    
    
      Other option is to use the system-properties element in the server configuration.
    

infinispanhotrodclient-playground-retrieveentrieswithfilter's People

Contributors

wfink avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.