A simmering labor dispute at major West Coast ports has slowed exports and imports dramatically in the past few weeks, rattling Midwest grain shippers, further slowing rail traffic and causing large retailers to work around the system to ensure ample consumer goods for holiday shopping.

The labor dispute pits the 20,000-member International Longshore and Warehouse Union against the Pacific Maritime Association, which represents terminal operators and shipping carriers. The union works at 29 West Coast ports from Bellingham, Wash., to San Diego and has been working without a contract since July 1.

That wasn’t a problem until early November, when the association accused the union of a series of work slowdowns in Seattle, Tacoma and Oakland. The union denies a work slowdown, and said the congestion is the result of numerous operational problems.

“This is serious, and it’s frustrating,” said Bob Sinner, president of SB&B Inc., of Casselton, N.D.

Sinner’s family business ships about 240 containers of high-quality soybeans by rail each month from St. Paul to the Pacific Northwest. Last month he could not send any containers to those ports because, he said, they were in virtual gridlock. Some containers were routed longer distances through Canadian ports, he said, and the rest are still waiting.

“Do I sound like I’m angry?” Sinner said. “Darned right I’m angry.”

The dispute affects any cargo that needs to be shipped in containers, including fruit, vegetables, wine, beef and pork, high-protein distillers dried feed grain from ethanol plants, and specialty soybeans. It does not affect bulk vessels that ship Midwest corn and soybeans for animal feed abroad.

It also affects imports, and vessels brimming with 10,000 containers each are anchored in Seattle’s Elliott Bay, Tacoma’s Commencement Bay and off California ports, waiting for berths so their cargoes can be off-loaded and transferred to trucks and railroads.

Aram Rubinson, an analyst with Wolfe Research, said that holiday merchandise shouldn’t be affected by the port delays since retailers in Minnesota and elsewhere began preparing for this issue months ago. But, he said in a recent research note, continued delays could affect inventories in early 2015.

Because of the worsening congestion, BNSF Railway Co. on Nov. 20 halted all shipments from St. Paul of empty railcars bound for Seattle or Tacoma that would pick up containers from ships. It also declared similar restrictions at its container facilities in the Chicago area, Omaha and Denver until further notice.

“The reduction in labor productivity at the Pacific Northwest marine terminals continues to impact BNSF’s normal service to and from the ports in Seattle and Tacoma,” spokeswoman Amy McBeth said in a statement.

Bruce Abbe, executive director of the Midwest Shippers Association, said a similar stalemate between the union and maritime association in 2002 led to a lockout that cost the U.S. economy billions of dollars.

“Our exporters are losing sales right now,” said Abbe, whose association works with exporters and shippers, including 25 firms in the region involved in specialty soybean businesses. “This could hit the millions if not the billions of dollars out of the Midwest if you look at how many of our exports are being held up at this point,” he said.

The Midwest Shippers Association was one of more than 60 groups that signed a letter to President Obama two weeks ago, calling on him to bring in a federal mediator or use other means to help resolve the contract negotiations and avoid a complete shutdown.

“The current disruption at the ports has already caused millions of dollars in economic injury at precisely the busiest time for agriculture exports,” they said. If products cannot be delivered on time, they said, foreign customers will turn to Brazil, Australia, Chile or Argentina.

A White House spokesman said the president is monitoring the situation, but isn’t planning to force a resolution.

Sinner’s company produces and ships food-grade soybeans to 15 countries, including firms in Japan, Korea and Taiwan that process them into tofu, soy sauce, soy milk and other products.

“These are cleaned, sized, packaged for customer specification and loaded with traceable information on every single package because they’re going directly into the [human] food business,” he said. They are not genetically modified soybeans, in keeping with customer requirements.

The bags are loaded into shipping containers that are 8 feet wide, 8 feet tall and 20 feet long.

They are sealed at the time of loading, and not opened until they reach their final destination. Many of those customers depend on reliable shipments for “just in time” delivery, said Sinner, and will charge extra fees if soybeans are late, or cancel contracts altogether and switch their business to a different supplier.

Sam Ziegler, director of marketing for the Minnesota Soybean Growers Association, said the West Coast slowdown affects about 5 percent of the state’s soybeans — 15 million bushels — that are a high-value export because of their uses for human food. It also threatens to affect the Midwest meat industry, he said, which sends beef and pork in refrigerated containers to Asian markets.

Delays at the ports are further compounding a troublesome year for grain transportation, Ziegler said, which included rail congestion for much of the year because of heavy demand for coal, consumer goods and oil shipments along the northern corridor, and a barge shipping season on the Mississippi River that started two weeks late and ended one week early because of unseasonably cold weather.

Retailers have been preparing for months for the slowdown, with many bringing in more inventory than normal in recent months to help blunt the blow during the crucial holiday season. The National Retail Federation said imported cargo volume to the nation’s major ports reached record levels in September and October as retailers rushed to bring in merchandise ahead of a possible West Coast port shutdown. But the trade group said it expected the import volume to slow down in November.

Minneapolis-based Target Corp. told investors last month that it had more inventory on hand than it did at the same time last year in part to mitigate the impact of the West Coast port slowdown.

Molly Snyder, a Target spokeswoman, said this week that the retailer has also been diverting cargo to alternative ports in the U.S. as necessary. In addition, Target has been working to get shipments from the ports to fulfillment centers and stores more quickly through a number of ways. For example, it is using air freight to move key seasonal and advertised items once they make it through the ports. And it is also working with additional trucking companies to help move other products from the ports, she said.

“As we are now in the midst of the busy holiday season, it remains our hope that all of the parties involved can arrive at a mutually agreeable solution soon,” Snyder said in an e-mail.

Richfield-based Best Buy has called out a “potential supply chain disruption” related to the West Coast port delays as one of the factors that could put pressure on the company in the fourth quarter. But executives also noted that they ramped up their inventory purchases in anticipation of those delays.