This is a project that based on the position of clients in a retail place finds patterns between them and products. It takes account Implicit and explicit whishlist of the clients and current offers that the store runs.
This is part of a bigger project that is capable of sending push notifications to clients when it seems beneficial based on collected data.
- Esper Dependacy - Complex event proccecing language, compiler and runtime
- RabbitMQ - sending and receiving messages
- XAMPP - Storing and fetching data for analysis
-
Clone this repository localy
-
Run XAMPP servers
-
Import ProximiotDB.sql and CMS.sql using phpMyadmin internal tool
-
Start the RabbitMQ service
-
Open LocationEsper and LocationSenderRMQ projects seperatly using IDE of your choice
-
Run LocationEsper
If the above steps were executed correctly you will see this on your IDE terminal after some initialization info:
[*] Waiting for messages. To exit press CTRL+C
-
Run LocationSenderRMQ
After this the LocationEsper should print on terminal something like this :
------------****------------ Client with sessionID:8 and id 5 stays close to product: 32 ------------****------------
------------****------------ Client with sessionID 8 is interested for product with id :32 relevance -> 16 ------------****------------
------------****------------ Client with sessionID: 8 staying close to a place 14 times -> Lat:-52.0 Lon: 50.0 Floor:1IDs :78 ------------****------------
------------****------------ Client with sessionID:8 and id 5 stays close to product: 33 ------------****------------
In order to initialize our program we are using the Clients , Ad campaigns and Product tables storing data on three arraylist.
LocationEsper:
- Program initialization : The program reads the Esper language (EPL) queries from the
queries.epl
file and attach listeners to any queries we choose to - Opening connection to RabbitMQ : We determine the host name and queue name where we want to listen
- The program waits idle for incoming messages
LocationSenderRMQ
- The program opens a connection to localhost and fetch location data from the ClientLocation table
- For every entry a message is sent to a RabbitMQ queue
- After this LocationEsper program reads the incoming messages from the RabbitMQ queue and translates it to a Java class object and stores this event on the Arraylist of the specific client.
- When the arraylist size passes a thresshold we tranfer this data from the Arraylist to Esper internal proccess machine in order to recognize any pattern based on the movement of the client.
- For any recognized pattern we can see the result on our console as prints about the nature of the pattern
The program also supports sending messages on a RabbitMQ queue in order fo
The main events that recognize patters are :
- closeNtimes : Determines if a client is staying around a place for continuous events
- associate : Checks if the place where the client is around is close to a product
- updateRel : Updates the relevance between a client and a product
- passThresholdProd : Checks if the relevance has passsed a user defined thresshold wich means that the client is interested about this product
Inside the project there is a Java class named Configurations where anyone can change the parameters in order to run the program using remote hosts. You can also change the thresshold about the size of the Arraylist.
Many aspects of the code can be configurable in order to enchance accuracy of the program so the file will see future updates.