It depends on you. If you are one of those developers, who like butterflies fly from one framework du jour to another, then you will find yourself obsolete pretty fast. There is always going to be someone with more time on their hands to convert Spring to asm.js that runs in JS emulator implemented in Haskell.
If on the other hand you are interested in what is the business purpose of what you are doing, then you may have a long and rewarding engineering career ahead of you. Developers of 1st kind (butterflies) are dime a dozen. Second kind is much harder to find - someone who understands the business. I would recommend to specialize in business, but remain a generalist in technology (they haven't invented anything new since LISP and APL anyways). As a bonus, if you get sick of development or modern developers, then you can easily transition to business side.
If on the other hand you are interested in what is the business purpose of what you are doing, then you may have a long and rewarding engineering career ahead of you. Developers of 1st kind (butterflies) are dime a dozen. Second kind is much harder to find - someone who understands the business. I would recommend to specialize in business, but remain a generalist in technology (they haven't invented anything new since LISP and APL anyways). As a bonus, if you get sick of development or modern developers, then you can easily transition to business side.
I am in mid 40's, work in Finance.