code: public org.jgroups.Message toJGroupsMessage(Message<?> cMessage) throws IOException {
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      JsonGenerator generator = factory.createJsonGenerator(out);
      generator.writeStartObject();
      generator.writeObjectField("header", cMessage.getHeader());
      if( cMessage.getBody() != null ) {
        generator.writeObjectField("body", cMessage.getBody());
      }
      generator.writeEndObject();
      generator.close();
      
      org.jgroups.Message jgMessage = new org.jgroups.Message();
      jgMessage.setBuffer(out.toByteArray());
      return jgMessage;
    }
docs: Serialized the cadmium message object into JSON and returns it as a JGroups message.
  
  @param cMessage the cadmium message to convert.
  @return The JGroups message containing the JSON string of the cadmium message.
  @throws IOException if there is a problem serializing the message.