public override void OnEvent(ConnectionManager connMgr, Status status, Connection.ConnectionEvent connEvent) { if (status.IsError()) { Log.Error("[ExampleReplyCallback::OnEvent] " + status.Get() + ", event=" + connEvent); } }
public override void OnEvent(ConnectionManager connMgr, Status status, Connection.ConnectionEvent connEvent) { // Print the status of publish operations. This includes counts // for successes, warnings, and errors. Log.Info(status.GetReason()); if (status.IsError()) { Log.Error("The first occurrence of a WebSphere MQ Asynchronous Put Response warning or failure returned the WebSphere Reason Code: " + status.GetCustomCode()); } EventFired = true; }
public override void OnEvent(ConnectionManager connMgr, Status status, Connection.ConnectionEvent connEvent) { // Perform some action based on the type of event that occurred if (connEvent == Connection.ConnectionEvent.CONNECTION_SUCCESSFUL_EVENT) { Log.Info("Connected to the middleware server"); } else if (connEvent == Connection.ConnectionEvent.CONNECTION_BROKEN_EVENT) { Log.Info("Connection to the middleware lost or terminated"); } else if (connEvent == Connection.ConnectionEvent.CONNECTION_RECONNECT_EVENT) { Log.Info("Attempting to reestablish the connection to the middleware"); } }
public override void OnEvent(ConnectionManager connMgr, Status status, Connection.ConnectionEvent connEvent) { switch (connEvent) { case Connection.ConnectionEvent.CONNECTION_SUCCESSFUL_EVENT: Log.Info("[OnEvent]: Connected to the middleware server"); break; case Connection.ConnectionEvent.CONNECTION_BROKEN_EVENT: Log.Info("[OnEvent]: Connection to the middleware lost or terminated"); break; case Connection.ConnectionEvent.CONNECTION_RECONNECT_EVENT: Log.Info("[OnEvent]: Attempting to reestablish the connection to the middleware"); break; default: Log.Info("[OnEvent]: " + status.Get()); break; } }