I made an application that connect to MQ server and getting message then do something with the message.
But I don't get how to make a test code for this kind of application.
Is there a way to make a fake message to send to the function subscribe?
the below code is I wrote for the application
def subscribe(mq_server):
// connecting to the server and return message
return messages
def get_message():
while True:
//getting message from MQ server
messages = subscribe(mq_server)
// do something with the messages
if __name__ == '__main__':
get_message()
Aucun commentaire:
Enregistrer un commentaire