I have been facing a problem where I got duplicate messages from Messenger's API while developing a chatbot.
I have been looking for a solution and tweeted for help. At the end I got to the following explanation:
Duplicate message postbacks is almost always because fb didn't hear a 200 response and the request ending soon enough. Depending on your language this could be tricky. In php for example not only do you have to respond with 200 ok early, you have to actively clear the buffer and end the connection for fb to receive the response. (Then you can do more processing if needed). Other languages may have something similar.
as mentioned here.
I have attached the solution above. Just make sure you put that directly when the PHP entry point starts running