You have a wide range of structural adhesive possibilities here. Normally, you require an adhesive that has been toughened with a rubber for this. Very rigid, quite brittle adhesives have been successful, however.
The most well-known application is the use of so-called “anaerobic” adhesives for the vibration proofing of threaded assemblies. Despite the brittle nature of these adhesives, they effectively adhere and fill the space between threads and prevent loosening of assemblies during vibration. They are tested using a Junker test, which is a mechanical test to determine the point at which a bolted joint loses its preload when subjected to shear loading caused by transverse vibration (ISO 16130 Standard test).