Hi! Stompest works great for me, pretty much out of the box, connecting to an activemq server.
Here's my question:
How should I structure a python application, when I want to subscribe to a rather busy activemq topic, and check each message to see if it matches something interesting.
When it does match something intersting, I want to pass that message into (I guess?) another function, to do *something*. In this case, it'll turn said data into a json object and http post it somewhere.
So, my activemq server is pretty busy. In the topic I'm interested in, I probably see to the tune of a couple hundred messages per minute.
So, right now I run stompest client in main(). And within that function, I am parsing the mq messages and posting them. But, how can I tell performance characteristics of that? Like, that can't scale, can it?
if data['alert']['deviceRef']['refName'] == '<devicerefname>':
payload = {"roomId":"somid","text":"'got some alert"}
headers = {'Authorization':'Bearer , 'Content-type':'application/json; charset=utf-8'}
rPostMessage =
requests.post("
https://api.com/v1/URI", data=json.dumps(payload),
headers=headers, verify=True)
message_Response = json.loads(rPostMessage.text)
print message_Response
client.ack(frame)
client.disconnect()
If anyone can give like a basic, even pseudo-code example of something that could work, or lessons learned. I don't know :( I'm probably too new to even ask the right questions. Which makes me avoid asking questions on SO.