In general, no, the convoy system was not a successful strategy because the Germans generally were not afraid to sink the convoys either. But there were instances in which the convoys would engage with a Germany boat and win.
The XYZ Affair was a political and diplomatic episode in 1797 and 1798, early in the administration of John Adams, involving a confrontation between the United States and Republican France that led to an undeclared war called the Quasi-War.