This service manages data flows in system for automatic searching advertisements on e-commerce web sites
To generate fat executable jar use
sbt clean assembly
The jar will be available in target/scala-2.13/scrapper-search-service-assembly-0.1.jar
.
To run it use:
java -jar target/scala-2.13/scrapper-search-service-assembly-0.1.jar
docker build -t search-service . && docker run -p 30001:30001 --name offer-rider-search-service search-service
The service periodically emits new tasks on pt-scraper-search-tasks
channel. These events indicate start of new search tasks.
Sent message:
{
"taskId": "uuid, the id assigned to this task",
"params": {
"key1": "textValue",
"key2": "numberValueAsText"
}
}
The service listens for search results on pt-scraper-results
channel. These events indicates new result entry for task started by earlier event.
Awaited message:
{
"result" : {
"taskId": "uuid, the id of task this result belongs to",
"title": "string",
"subtitle": "string?",
"url": "string?",
"imgUrl": "string?",
"params": {
"key1": "textValue",
"key2": "numberValueAsText"
}
}
"last": "bool, true if no further results will be emitted for this taskId"
}
POST /search
GET /search
GET /tasks
GET /results
The rest api allows clients to see and manage searches, tasks and results.
To discover and perform sample requests use the Postman collections from docs/scraper-search-service.postman_collection.json
. In order to run the collections environment variable HOST
must be defined.
tba