In a medium skillet, sauté onion in olive oil over medium heat until soft. Season with salt and pepper. Add the apple, rosemary, vinegar and brown sugar. Cook for 1-2 minutes. Add rhubarb and cook over low heat, stirring often, until the rhubarb is soft (about 15 minutes). Season again with salt and pepper to taste.
Let the flavours of this compote meld in the refrigerator for about 5 days.
Explore serving this savoury compote on your favourite summer dishes — try it on barbecued pork chops, and fish, as shown in the adjacent image.