The Somali farming communities of the hinterland from Jubba and Shebella valleys brought their crops to the Somali coastal cities, where they were sold to local merchants who maintained a lucrative foreign commerce with ships sailing to and coming from Arabia, Persia, India, Venice, Egypt, Portugal, and as far away as Java and China.