Rear derailleur cable adjusters often need replacing as a result of bending or corrosion. Original Shimano replacements can often be in short supply, but these Alligator adjusters will do the job well.
M5 thread. Thread is 11mm long. Black anodized alloy adjuster, stainless steel spring. The spring is probably best not used so you have more adjustment range. It would be unlikely for the adjuster to lose its adjustment as a result of the missing spring as the casing endcap will also do the job of stopping it from turning on its own.