Real-time inventory demo based on data from brewerydb.com.
git clone https://github.com/Redislabs-Solution-Architects/brewdis.git
cd brewdis
docker-compose up
Access the demo at http://localhost
An overview of the business context and demo architecture is available at pages.brewdis.demo.redislabs.com
💡
|
Hit the S key to open speaker notes
|
-
Launch
redis-cli
-
Show number of documents in RediSearch index:
FT.INFO products
-
Run simple keyword search:
FT.SEARCH products chambly
💡name
,description
,breweryName
are phonetic text fields so you will notice results containing words that sound similar. -
Run prefix search:
FT.SEARCH products chamb*
-
Open http://localhost
-
Enter a simple keyword search, e.g.
chambly
. Note highlighted matches. -
Expand the filter panel by clicking on the filter button:
-
Enter some characters in the Brewery field to retrieve suggestions from RediSearch (e.g.
Unib
) -
Click the
Submit
button -
Refine the search by adding a constraint on the alcohol content (ABV field):
@abv:[7 9]
-
Change the sort-by field to
ABV
and clickSubmit
-
Click
Availability
on one of the search results. This takes you to the availability map for that product. -
The map shows stores near you where the selected product is currently available.
-
Stores in
green
have more than 20 in stock,amber
: 10 to 20,red
: less than 10
The app server is built with Spring Boot which can be configured different ways: Spring Boot Externalized Configuration. Depending on the way you’re running the demo you can either:
-
create a
application.properties
file based on the one that ships with Brewdis -
specify JVM arguments like this:
java -jar brewdis.jar --spring.redis.host=localhost --spring.redis.port=6379 ...
-
use environment variables:
export spring.redis.host=localhost export spring.redis.port=8080 export ... java -jar brewdis.jar
Here are the most common configuration options for this demo:
-
spring.redis.host
: Redis database hostname (default:localhost
) -
spring.redis.port
: Redis database port (default:6379
) -
stomp.host
: Websocket server hostname (default:localhost
) -
stomp.port
: Websocket server port (default:8080
) -
stomp.protocol
: Websocket protocol (default:ws
). Usewss
for secure websockets -
inventory.generator.rate
: duration in millis the generator should sleep between inventory updates (default:100
) -
availability-radius
: radius to find in-store availability (default:25 mi
)