protected override void CheckRouting(AEMPayload payload, bool isDirectMessage) { // if (payload.IsDirectMessage && !isDirectMessage) return; try { if (payload.IsLexiconTerm(LexiconTermEnum.programmer_hello_world)) { this.OnProgrammerHelloReceived(payload); } else if (payload.IsLexiconTerm(LexiconTermEnum.programmer_goodbye_world)) { this.OnProgrammerGoodbyeReceived(payload); } // And can also hear everything which : Programmer hears. if (payload.IsLexiconTerm(LexiconTermEnum.world_wassup_programmer)) { this.OnWorldWassupReceived(payload); } } catch (Exception ex) { payload.Exception = ex; } this.Reply(payload); }
protected virtual void OnProgrammerGoodbyeReceived(AEMPayload payload) { this.LogMessage(payload, "Goodbye - "); var plea = new PayloadEventArgs <AEMPayload>(payload); this.Invoke(this.ProgrammerGoodbyeReceived, plea); }
protected virtual void OnWorldWassupReceived(AEMPayload payload) { this.LogMessage(payload, "Wassup - "); var plea = new PayloadEventArgs <AEMPayload>(payload); this.Invoke(this.WorldWassupReceived, plea); }
public void LogMessage(AEMPayload payload, System.String msg) { if (IsDebugMode) { System.Diagnostics.Debug.WriteLine(msg); System.Diagnostics.Debug.WriteLine("payload: " + payload.SafeToString()); } }
private void Reply(AEMPayload payload) { if (!System.String.IsNullOrEmpty(payload.ReplyTo)) { payload.DirectMessageQueue = this.QueueName; this.CheckPayload(payload); this.RMQChannel.BasicPublish("", payload.ReplyTo, body: Encoding.UTF8.GetBytes(payload.ToJSonString())); } }
protected override void CheckRouting(AEMPayload payload, bool isDirectMessage) { // if (payload.IsDirectMessage && !isDirectMessage) return; try { if (payload.IsLexiconTerm(LexiconTermEnum.world_wassup_programmer)) { this.OnWorldWassupReceived(payload); } } catch (Exception ex) { payload.Exception = ex; } this.Reply(payload); }
partial void CheckPayload(AEMPayload payload);
protected override void CheckRouting(AEMPayload payload) { this.CheckRouting(payload, false); }
/// <summary> /// Goodbye - /// </summary> public void ProgrammerGoodbye(AEMPayload payload) { this.SendMessage(payload, "Goodbye - ", "programmermic", "world.general.programmer.goodbye"); }
/// <summary> /// Hello - /// </summary> public void ProgrammerHello(AEMPayload payload) { this.SendMessage(payload, "Hello - ", "programmermic", "world.general.programmer.hello"); }
/// <summary> /// Wassup - /// </summary> public void WorldWassup(AEMPayload payload) { this.SendMessage(payload, "Wassup - ", "worldmic", "programmer.general.world.wassup"); }