tuw_json helps to read and write msgs in json format
Links
Rosindex
Package to write and read msgs into json
have a look on the unittest
unittest