2

I'm presently working on my ubuntu(14.04) system. In my project there are three servers apart from the broker. The core is the flask server. The other two are Scrapyd and Sentiment Analysis server.

Using the tutorial 'Work Queues', I have managed to write consumer as well as producer code for the broker between Scrapyd (via pipelining) and flask, and similarly using the 'RPC' part of the tutorial. I have written code for SA server and the flask server.

The problem is, the flask server has become a consumer at two ends. It is waiting for response from the scrapyd as well as SA server. The whole idea is to take data from the scraper, transfer it to the SA server and take back the response and pass it on to the front-end. Now, the only way I could think of getting data from the "consumer" part of the code to the code running in the 'view' function of the flask server is via the 'callback' function in the rabbitmq consumer.

Presently, I was trying this way:

Once the data from the scraper arrives at flask end, we create an object of the other 'consumer' (the one who will interact with the SA server), and transfer data through that object. This is done in the callback function of the consumer side of the broker between the Scraper and the Flask Server. Till this was fine. The problem arises when the data from the SA server arrives. I don't know how am I supposed to take data from the callback function of the consumer part of the broker code to the 'view' function of the flask app.

dirn
  • 19,454
  • 5
  • 69
  • 74
Vivek Anand
  • 621
  • 1
  • 7
  • 15

0 Answers0