Derringeer,
A barrel has no recoil of its own. It is just a hollow cylinder and the pressure inside it pushes outward radially along its axis, trying to expand it. Pressure does not push it either forward or backward. Recoil all comes from pressure pushing back on the cartridge case which passes that force to the breech of the gun. Because the barrel is securely attached to the receiver through barrel threads and the receiver is securely attached to the breech through the gun's locking mechanism, the breech pulls the barrel back. It does not propel itself in any way.
For anyone who doesn't think a cartridge case can blow up,
watch this video.