... surprisingly, this is not much of an issue. The key property for keeping a rocket engine from melting is not high melting point, but high thermal conductivity. Because of this, all the parts that touch the hot flame are made from a copper alloy, with a melting point not far from that of pure gold.
In the chamber, the hot gases are >3500K, and touching the inner walls with a melting point at ~1400K, yet the walls don't melt, because they are cooled with more power than they are heated.