public static String serializeCoordinatorMessageKeyToJson(String type, String key) {
    try {
      CoordinatorMessageKey coordinatorMessageKey = new CoordinatorMessageKey(key, type);
      return OBJECT_MAPPER.writeValueAsString(coordinatorMessageKey);
    } catch (IOException e) {
      throw new SamzaException(String.format("Exception occurred when serializing metadata for type: %s, key: %s", type, key), e);
    }
  }
Serializes the {@link CoordinatorMessageKey} into a json string.

@param type the type of the coordinator message.
@param key the key associated with the type
@return the CoordinatorMessageKey serialized to a json string.
samza-core/src/main/java/org/apache/samza/coordinator/metadatastore/CoordinatorStreamStore.java