With so much chatter about low oil and gas prices and pipeline bottlenecks, one could be forgiven for thinking that Canada’s energy sector is not a place to invest. Investors are concerned not just about prices and pipelines, but about the long-term viability of fossil fuel-producing companies in a world facing more and more constraints on CO2 production.

But there is one segment of the energy sector that has been providing good returns and is likely to do so for years to come: the midstream. These are the companies that own the pipelines, processing facilities and storage tanks that move raw product from the producers to the refiners. This segment is less affected by commodity prices than the upstream and downstream segments because its revenue is derived from long-term, fee-based contracts. For the pipeliners, the fact that getting new pipe in the ground is difficult means the pipelines these companies own are becoming more valuable.

Indeed, there has been quite a steady stream of good news for midstreamers in recent months. In early August, Calgary’s Inter Pipeline Ltd. posted a record Q2 net income of $260 million and received an unsolicited bid that drove the share price up by 14% in two days. The company also is in the midst of building a $3.5- billion petrochemical complex in Alberta to make plastic from the cheap, readily available propane in the province.

TC Energy Corp. (formerly TransCanada Corp.) also got a win in August, when the Nebraska Supreme Court ruled that regulators’ approval of the route for the proposed Keystone XL oil pipeline is valid. The pipeline still faces hurdles, with another legal challenge underway in Montana, but the Nebraska court’s decision represents a major hurdle overcome.

The biggest midstreamer of them all, Enbridge Inc., has been flexing its muscles lately. The company reached an agreement with shippers to place the Canadian portion of the Line 3 replacement pipeline into service by the end of this year. Enbridge also proposes to change the way it assigns space on its Canadian Mainline pipeline system, which moves 70% of Canada’s oil.

Until now, producers have paid a set toll for each barrel of oil they ship on the Mainline. Enbridge proposes that 90% of that pipeline system’s capacity be reserved for shippers who enter into contracts of up to 20 years.

Suncor Energy Inc., Canadian Natural Resources Ltd., Shell Canada Ltd. and MEG Energy Corp., along with the Explorers and Producers Association of Canada, argued before the National Energy Board that Enbridge is operating like a monopoly. If 70% isn’t a monopoly, it’s certainly a lot of bargaining power.

Other midstreamers are doing well. Shares of Keyera Corp., Pembina Pipeline Corp., Gibson Energy Inc. and others have gained 20% or more this year. That compares with a 12% drop in the Toronto Stock Exchange energy index overall. It seems this is a good time to be swimming midstream.