Controlling relays using mqtt

Hi, i’ve got my spark core with the relay shield working fine and i am using blynk app to controll it using my phone. But now i am trying openhab gui for making automation more user friendly and i am planning to use mqtt for making communication faster so i start watching the mqtt library for spark core but i don’t know if i should modify it for controlling the relays. Can anyone help me with this? Maybe some tutorials have been made but i cant find examples using spark core and mqtt library for controlling relays.

Thanks in advance.