With just a few trading days left, 2017 is on track to be a banner stock-market year as indexes rise by more than 15%. Of course, many individual stocks have performed well in the context of that strong overall growth.

It's much harder for dividend investors to find companies that can thrive during booms like this -- and through those inevitable bear markets. With that challenge in mind, we asked Motley Fool investors to highlight a few income investments that meet this tough standard. Below, they offer 3M (NYSE:MMM), Wal-Mart Stores (NYSE:WMT), and Microsoft (NASDAQ:MSFT) as unusually stable income candidates.

A jar of coins labeled "dividends"

Image source: Getty Images.

This dividend champ has survived some of the worst market crashes

Neha Chamaria (3M): If you're looking for dividend stocks that can thrive in both bull and bear markets, what better than stocks that not only have paid a dividend for decades, but even increased it during the weakest business cycles in the past? Case in point: Dividend Aristocrat 3M, a stock that has what it takes to reward investors with a steady flow of income no matter where the end markets are.

Its dividend record is one of the best among publicly listed companies -- the industrial conglomerate has paid a dividend for 100 consecutive years and increased it for 59 straight years. This incredible streak can largely be credited to 3M's hugely diverse portfolio, which consists of more than 60,000 products under top-notch brands such as Post-it and Scotch and serves nearly every key industry you can think of.

The company's diversity, along with prudent capital allocation, is why 3M has been able to offset pockets of weakness in one or more industries with strength in others over the years. It also allowed 3M to grow profits and cash flows consistently, so much so that the company could raise its dividends even during tough periods like the 2008 market crash, when 3M's stock price also took a deep cut. And when the going gets good, so do 3M's dividend increases, as has been the case in recent years:

MMM Dividend Chart

MMM Dividend data by YCharts.

This chart shows that 3M is the kind of dividend stock that can thrive in any market. While its yield might be a low 2%, 3M's stable and growing dividends should keep income investors happy for years to come.

Bigger is better

Demitri Kalogeropoulos (Wal-Mart): Recessions cause demand for discretionary purchases like new cars and homes to dip, but they don't have the same impact on everyday essentials, which remain relatively stable over time. In fact, a bear market can be good for companies like Wal-Mart that have carved out defensible niches focused on pricing authority.

A customer browses the aisles at Walmart

Image source: Wal-Mart.

That helps explain how the world's biggest retailer has kept its dividend rising for a string of 44 consecutive years -- through booms and busts alike.

The combination of slower sales growth and falling earnings (due to increased spending on employee wages and the digital sales channel) has made Wal-Mart a more aggressive dividend stock lately. It now pays out over half of its profits as dividends, compared to less than one-third as recently as 2012. But its latest operating results suggest income investors could enjoy both a hefty dividend and solid sales gains from this stock. Wal-Mart's comparable-store sales growth sped up to a pace of 2.7% last quarter, thanks to rising customer traffic. Its e-commerce revenue soared by more than 50%, too.

Wal-Mart logged just under $500 billion of revenue over its last fiscal year, and it generated over $31 billion of operating cash flow from that sales haul. That massive base means that growth will inevitably be slow from here. But it also creates a large financial cushion from which Wal-Mart can increase its dividend payments through a wide range of market cycles ahead.

Mr. Softie won't melt in a market meltdown

Rich Smith (Microsoft): This is going to sound crazy, but have you considered investing in a tech stock like Microsoft as a hedge against bear markets?

I know, I know: Tech stocks are supposed to be volatile. They do great in bull markets -- Microsoft stock is up 35% over the past year, and has tripled over the past five years -- but that volatility is supposed to be a real bear for tech investors to deal with in bear markets.

But here's the thing: What really worries me about any stock at the start of a bear market is how likely it is to come out of the bear market. Simply put, has the company banked enough cash in the good times to weather the bad times and emerge intact on the other side?

Microsoft certainly has. According to data from S&P Global Market Intelligence, Microsoft's balance sheet is simply brimming with cash: $133.6 billion in cash, equivalents, and short-term investments; a further $5.4 billion in long-term investments -- but only $76.2 billion in long-term debt. As I calculate it, this gives Microsoft a net cash balance of nearly $63 billion, which is enough to pay the company's 2.1% dividend yield for nearly five years straight -- or to cover all its operating costs for nearly two straight years -- with no revenue coming in at all.

That's some good bear-market insurance for you, right there.

Teresa Kersten is an employee of LinkedIn and is a member of The Motley Fool's board of directors; LinkedIn is owned by Microsoft. Demitrios Kalogeropoulos has no position in any of the stocks mentioned. Neha Chamaria has no position in any of the stocks mentioned. Rich Smith has no position in any of the stocks mentioned. The Motley Fool recommends 3M. The Motley Fool has a disclosure policy.