In this paper we study the problem of routing in opportunistic wireless network, and propose a novel routing mechanism, message-aware routing (MAR). Using MAR, the messages can be prioritized at mobile nodes and the resources will be allocated accordingly. The MAR uses the message-aware socializing model to classify mobile nodes into different social groups. In MAR, nodes only maintain up-to-date routing information for the nodes in the same social group and the messages for the nodes in the same social group will have higher priority to be delivered. The MAR improves the routing efficiency in terms of reduced traffic and a higher delivery success rate. Further, MAR is constructed in decentralized way and does not require any centralized infrastructure. Experiments using NS2 simulator show that the MAR achieves higher delivery rate than the Epidemic and Prophet routing.