Hamas cannot win militarily in any conflict with Israel, yet they launch thousands of rockets against Israeli civilians, killing maybe 8. Israel predictably responds with overwhelming military force. This was bound to happen, so why did Hamas do it?
The blockade. True that Israel is blockading the Gaza Strip, but do unguided rockets resolve that issue? They don't, at least not directly. The Hamas rockets are used SOLELY to provoke Israel into an air and possibly a ground offensive that will kill hundreds of Gazans. THEN the world will take notice that people are dying and force a settlement. That settlement will be an end to Israeli airstrikes and a promise from Hamas to cease rockets attacks against Israel. This agreement will hold for about a month or so then Hamas will renew its rocket attacks.
Why is Israel blockading the Gaza Strip? Because Hamas was bringing in weapons and material to build rockets to hit Israel.
When did this start? After Israel ended its occupation of Gaza about 5 years ago.
Why did they end their occupation? As part of the "peace Agreement" with the PA.
What's the solution? There are a few options. Israel can withdraw back to pre-1967 borders in the hope that the people on the other side won't keep lobbing rockets into their country. Based on past experiences like the Gaza withdrawal, that's not too likely.
Israel can bomb Gaza and the West Bank and Golan Heights to dust, but the world won't like that so it's probably not an option.
Hamas can stop launching rockets for real, and Israel can end the blockade for real. Again based on past experience Hamas will probably be the first to break the ceasefire and the cycle will begin again.
On a side note, the world really didn't take much notice of the Hamas rockets over the past year. There were no demonstrations outside the UN or PA missions when this was going on and Israelis were being killed. No comments from any Canadian politicians prior to the latest Israeli action. But once they did comment, they were very clear that Israel has a right to defend itself against these rockets.