Building alternative to IBM WebSphere MQ in java (completely open source)

I have started exploring JMS recently. In order to fully understand what middle-ware is and it’s functionality , I wanted to build a Java based application that can perform as middle-ware. As per the knowledge I have gathered till now , I think with apache ActiveMQ and spring I can build that. Please share if anybody have any ideas/ applications / libraries .