This blog post will cover a Java-based tweets processor application whose role is to pick up tweets from Redis Streams and store them (as a HASH) so that they can be queried using RediSearch (the accurate term for this is “indexing documents” in RediSearch). You will deploy the application to Azure, validate it, run a few RediSearch queries to search tweets. Finally, there is a section where we will walk through the code to understand “how things work”.

Pre-requisites

Please make sure that you read part 2 of this series and have the Tweets consumer application up and running. This application will read tweets from the Twitter Streaming API and push them to Redis Streams. Our tweets processor app (the one described in this blog) will then take over.

You will need an Azure account which you can get for free and the Azure CLI. Like the previous application, this one will also be deployed to Azure Container Instances using regular Docker CLI commands. This capability is enabled by integration between Docker and Azure. Just ensure that you have Docker Desktop version 2.3.0.5 or later, for WindowsmacOS, or install the Docker ACI Integration CLI for Linux.

Deploy the App to Azure Container Instances

If you’ve been following along from the previous blog post, you should have set up the Enterprise tier of Azure Cache for Redis, using this quickstart. Once you finish this step, ensure that you save the following information: the Redis host name and Access key

The application is available as a Docker container - the easiest way is to simply re-use it. If you wish to build your own image, please use the Dockerfile available on the GitHub repo.

If you choose to build your own image, make sure to build the JAR file using Maven (mvn clean install) first

It’s really convenient to deploy it to Azure Container Instances, which allows you to run Docker containers on-demand in a managed, serverless Azure environment.

Make sure you create an Azure context to associate Docker with an Azure subscription and resource group so you can create and manage container instances.

docker login azure
docker context create aci aci-context
docker context use aci-context

#java #big data #nosql #docker #azure #redis #databases

Redis Streams in Action — Part 3 (Tweet Processor)
1.30 GEEK