private void ProcessMessages(ITenant tenant, TenantMessage message) { tenant.ClearApiContainer(); //"Processing message " + message.Event + " for tenant " + tenant.Settings.TenantId; try { if (message.Event != EventType.ServiceRequestStateChangedEvent) { return; } var serviceRequestStateChangedMessage = message.GetBody <ServiceRequestStateChangedMessage>(); if (serviceRequestStateChangedMessage.NewStateEnum != ServiceRequestState.eIsWorkDone) { return; } // here you can execute the code if the service request state has changed e.g. write the data back } catch (Exception e) { } // Processing done }