An alhóndiga (from Medieval Spanish alfóndiga, in turn from Arabic al-fondaq, this in turn from Greek pandocheion, lit.: "welcome all") or almudí, almudín,  alholí, public house or neighbors' market was formerly an establishment where grain was sold, bought and even stored, whose purpose was to help the neighbors and mainly the farmers in times of shortage. It is historically equivalent or derived from the caravanserais (or funduqs) of the Muslim world.

In the  Kingdom of Aragon, Catalan consulates were established around the Mediterranean to control business. In such Consolats de Mar the alfòndec (same etymology as alhóndiga) was an important part of the ensemble, usually comprising storage, hospitality and church services.

The public almudíes were establishments managed by the city councils where all those who introduced any kind of grain to sell were obliged to carry them with the same object. The almudí was composed of large and spacious warehouses or markets in which various types of grain were conveniently placed. It was open during the day and to this deposit often came many bodies and individuals who wanted to acquire a certain amount of cereals for their needs. Each competitor or holder of grains satisfied by rights a price for each quantity of wheat, rye, millet, bean, corn, vicia faba, barley and oats which it kept.

Currently companies and cooperatives dedicated to the agricultural sector use the term alhóndiga in their social denominations, especially those of Andalusia and Murcia.

The function of these alhóndigas, in Andalusia and Murcia, is to unify the supply and demand of horticultural products, where the farmers take their products to the alhóndiga and this is responsible for auctioning them through a dynamic auction on the low in exchange for a commission.

References 

This contains information taken from the homonymous article in the Spanish Wikipedia.
 Guía de Zaragoza, 1860.