If the rocky area is relatively small, I'd think the river would flow around it, and not over/through it. There's no reason for a river to start eroding a rocky outcrop if it can avoid it: water generally follows the path of the least resistance ;-).

You could however have rocky islands in the middle of a stream as remnants of e.g. glacial erosion (large rocks deposited there after the retreat of a glacier, and just now being uncovered by the eroding of the river). This would result in rocky islands in a still relatively smooth flowing river, eradicating the need for an artificial port altogether.

There's one restriction to that theory, however. Such huge boulders could only have been taken there through glacial erosion, which means it should be in an area that once sported a glacier, an ice field or an ice cap (any of the three would do). Which in turn means the topography should still reflect that in some way. Check out the various post-glacial landscapes if you want to know if one fits the area your city is in.