Channel capacity and node energy represent resources and constraints in designing efficient routing schemes for Wireless Sensor Networks(WSNs). To delivery more data, a higher rate is desirable, which however consumes more energy and may demand more bandwidth. Hence, data transmission in WSNs should take into account both limited capacity and constrained energy. In this paper, we propose an utility-based nonlinear convex optimization formulation to maximize utility subject to the capacity and energy constraints. To achieve this, we introduce link interference set to represent all flows contention over a link, and it offers the capacity constraint over the specific link. For each node, we express the energy constraint with network lifetime requirement. A distributed solution with dual decomposition approach is proposed to address the optimization formulation. In addition, an Optimal Rate Routing (ORR) is developed by incorporating the optimization result to select the optimal rate route. Comparing with the previous schemes, ORR is able to achieve the highest utility, optimal rate selection during routing, and well-balanced performance.