In a large pot, bring 4 cups of the water to a boil. Add 1 1/4 cups of kosher salt, the sugar, mustard seeds, dried onion, caraway seeds, peppercorns, juniper berries and bay leaves. Stir until salt and sugar are completely dissolved. Remove pot from heat.
Line a container large enough to hold the turkey with two sturdy plastic bags. Put the turkey into the bags, neck first. Pour the warm brine over the turkey. Add 1 1/2 cups of the Riesling and 4 quarts of the cold water. Seal the bags; press out as much air as possible. Refrigerate for 2 days.
On Thanksgiving morning, preheat the oven to 350°. Drain the turkey, scraping off the spices, then transfer it to a large roasting pan and let it return to room temperature. If your family or guests are salt sensitive be sure to wash the turkey very well under cold water and dry completely with paper towels. Discard brine.
Add the quartered onion, garlic and 1 cup of water to the pan and roast the turkey for 1 1/2 hours. Add the remaining 1 cup of water to the pan and roast for about 1 1/2 hours longer, or until an instant-read thermometer inserted into an inner thigh registers 165°. Cover the breast loosely with foil during the last hour of roasting to prevent it from browning too quickly.
Transfer the turkey to a cutting board. Strain the pan juices into a measuring cup and skim off the fat; reserve 3 tablespoons of the fat. In a bowl, mix the reserved fat with the flour until a paste forms.
Place roasting pan over 2 burners and heat until sizzling. Add 1 cup of Riesling and bring to a simmer over moderately high heat, scraping up any browned bits from the bottom and sides of the pan. Strain the wine into a medium saucepan and boil until reduced to 1/4 cup, about 5 minutes. Add the stock and the reserved pan juices and bring to a boil. Whisk in the flour paste and simmer over moderate heat until the gravy thickens slightly and no floury taste remains, about 10 minutes. Season with salt and pepper.
Carve and serve with the Riesling gravy on the side.