SURABAYA, Indonesia — The docks at big Indonesian ports like this one are quieter these days, as China’s demand for raw materials has begun to cool.

But drive an hour inland and the agricultural giant Cargill is racing to finish a cocoa-bean processing plant, while a large instant-noodle factory is running full tilt to meet the demand for convenience food from Indonesia’s large and growing middle class. “We’re having quite a tough time keeping up,” said Tjun Sulestio, a general manager of the noodle factory, run by PT. Suprama.

The contrast in many emerging markets between signs of a looming currency crisis and strong domestic demand is visible around the world. Stock markets and currencies have fallen in recent months in places like Buenos Aires; Jakarta, Indonesia; Manila, and Istanbul, as investors have worried that weaker Chinese growth and a United States Federal Reserve that is pumping out fewer dollars will cause a global stumble in many developing nations.

Like limbo dancers struggling to shuffle under a low bar before standing upright again, emerging markets must shuffle along under weak commodity exports and capital outflows before they can recover their balance and let strong domestic demand for products like cars, electronics and instant noodles carry their economies forward again. The question is whether their consumers and businesses will continue to spend, or whether international troubles will spill into domestic economies in ways they cannot control.