Baseball season doesn’t officially begin for another two months, but the Mets already batted one out of the park today.

The ball club’s protracted fight with the vendor selling kosher hot dogs at Citi Field during Mets home games is finally coming to an end.

Today a federal judge ruled that the Mets have the right to restrict Kosher Sports Inc. from selling their wieners on the Jewish Sabbath, citing a contract between the two entities that does not explicitly guarantee weekend sales.

Two years ago, Kosher Sports — headed by former Wall Street trader Jonathan Katz — sued the Mets after claiming they were barred from selling hot dogs on Friday nights and Saturday, when attendance at ballgames tends to be higher.

The Mets argued that such sales violated the Jewish Sabbath, and internal ball-club e-mails cited concerns over a possible backlash from observant baseball fans.

At its core, the disagreement over baseball’s omnipresent snack food became a real “federal case” – and could arguably rank among the most bitterly contested legal disputes over hot dogs in the history of American jurisprudence.

In a litany of court hearings over a two-year period, voices were raised, accusations of trickery were leveled, and tempers flared during discussions about the fine points of selling hot dogs at Major League baseball games.

At one point, the case even produced something of a “Weiner-gate” – when the Mets accused Kosher Sports of surreptitiously recording conversations between executives of stadium concessions giant Aramark — and then employing a cover-up to hide the tapes from a federal judge.

Brooklyn federal Judge Jack Weinstein ruled today against Kosher Sports, throwing out its lawsuit against the Mets and holding that the hot dog vendor could be liable for damages because it stopped paying required annual fees to the ball-club.

The vendor – which sold its glatt-kosher dogs from pushcarts located on the stadium’s lower levels – refused to make the payments because, they argued, the Mets never told them they couldn’t sell wieners on the Sabbath until the 10-year contract was already signed.

In his four-page ruling, the judge held that the fine points of Kosher Sports’ agreement to sell hot dogs actually were laid out in a contract with Aramark, which controls most concessionaires at Citi Field. Aramark was not a party to the lawsuit.

The hot dog vendor’s contract directly with the Mets “does not” give Kosher Sports the right to sell its products at all events during the ten-year term of the agreement, the judge wrote.

The judge directed a federal magistrate judge to hammer out the details of the legal dispute’s resolution, and to decide how much Kosher Sports owes the Mets in damages – in addition to determining the future of the wiener vending contract.