In this paper, a multi-way relay channel is considered with energy harvesting nodes. The harvested energy at each node can be stored in a battery of finite capacity. Additionally, each node employs a data buffer of limited size to store data prior to transmission. Data packets to be exchanged between the nodes arrive at the source nodes in an intermittent fashion. In this setup, the offline sum throughput maximization problem, which turns out to be a convex optimization problem, is solved. The corresponding online problem is formulated, and a backward induction-based optimal solution is proposed. In addition, a near-optimum low complexity solution is presented. It is noted that the solutions for the offline and online throughput maximization problems for the multi-way relay channel also provide solutions for its special cases, e.g., the multi-pair two-way relay channel, the two-way channel, and others. Numerical results are presented to demonstrate the resulting optimal transmission policies for various channel setups, comparing the sum throughput to upper and lower bounds, and demonstrating the impact of buffer sizes at the relay.