In the common implementation of software defined networking where only one controller is used, tasks required by various applications may overwhelm the controller as the network grows, leading to degradation of the network performance. Some multi-controller architectures have been proposed to remedy such scalability issue. In this paper, we present our design and implementation of a routing application under a hierarchical multi-controller architecture. In this architecture, a network is partitioned into multiple domains, each of which is managed by a dedicated local controller, which is managed by a common global controller. The routing application is executed on the local and global controllers, jointly providing a routing service for each new flow. We provide effective mechanisms to reduce the link state that should be kept by the global controller. We propose a weight function on the links so that a weighted shortest path can be found that avoids the congested links on the network. Experiments results show that our routing application in the hierarchical multi-controller architecture has a great improvement over that of the singlecontroller architecture in terms various performance metrics.