* Subscribes to a channel for receiving events.
*
* @return An EventSubscription instance that can be used to unsubscribe.
*/
public EventSubscription subscribe(final String channel, final GenesysEventListener listener) {
final MessageListener bayeuxListener = new MessageListener() {
@Override public void onMessage(ClientSessionChannel channel, final Message message) {
LOG_EVENT.debug("Received event on channel: " + message.getChannel());
LOG_EVENT_CONTENT_RAW.debug("Content: " + message.getJSON());
if (LOG_EVENT_CONTENT_PRETTY.isDebugEnabled())
LOG_EVENT_CONTENT_PRETTY.debug("Content:\n" + JsonUtil.prettify(message.getJSON()));