This past season I experimented with a home made boat whip. If you look online they are hellishly expensive. I made a prototype with 1/2" schedule 40 inside 3/4" schedule 40 and connected to the dock with a flagpole bracket. The length was 4'. I mounted on the dock amidships so the far end was aft the cuddy and under the boom. I had a line from the end of the whip that I secured to the midship cleat.
If the boat moved toward the dock the whip flexed and moved it out again.
I intend to add a 1/4" diameter section of fiberglass rod to increase the stiffness and have at least two, maybe three whips.