Blanch shallots (not peeled) in boiling water 2 minutes, then drain in a colander and rinse under cold water to cool. Peel shallots, then combine with remaining ingredients in a 10-inch heavy skillet. Simmer, uncovered, over moderate heat, stirring occasionally, until shallots are tender, 20 to 25 minutes. Transfer to a bowl and cool. Chill, covered, at least 8 hours for flavors to meld. Discard whole spices. Serve at room temperature.