Since wireless sensors may be deployed in hard-to-reach or remote areas, managing their energy availability has become an important task. In order to prolong the network lifetime, several techniques have been adopted, and Wireless Sensor Networks (WSNs) with Energy Harvesting (EH) capabilities have been recently studied and deployed. We consider the case of an Energy Harvesting Device (EHD) with a packet data queue, with the main goal of maximizing the long-term average transmission rate. At each time instant, the device has different energy and data queue levels and can gather energy from the environment and receive or generate packets that are stored in the queue. We assume that the energy expenditure is mainly due to data transmission. We initially suppose to have a small battery and we study a particular subset of all policies, called almost geometric. Then, we analyze a system where the data buffer is finite and large with respect to the battery, computing the Optimal Policy (OP) and introducing a simple Low-Complexity almost geometric Policy (LCP). Finally, we numerically show that LCP can be considered as a good lower bound for OP.