/// <summary> /// 私人消息队列 /// </summary> public MessageQueueEvent() { BroadcastEvent be = new BroadcastEvent(); reg = MessageServer <BroadcastEvent> .Intialize(be, ConfigurationManager.AppSettings["service"], Convert.ToInt32(ConfigurationManager.AppSettings["port"])); if (reg.Channels.Count > 0) { this.channel = reg.Channels[0];//.Find(a => a.ChannelName == ConfigurationManager.AppSettings["service"]); } be.Channel = this.channel; if (reg.Uris.Count > 0) { this.uri = reg.Uris.Find(a => a.Segments[a.Segments.Length - 1] == ConfigurationManager.AppSettings["service"]); } }
/// <summary> /// 私人消息队列 /// </summary> public ClonableMessageTrunkQuery() { trunk = new KellPersistence.Trunk <ClonableObject>("KellMQ.ClonableObject"); messageNotifyEvent = new Dictionary <Guid, ClonableConsumeEventHandler>(); messagesNotifyEvent = new Dictionary <Guid, ClonableConsumingEventHandler>(); BroadcastEvent be = new BroadcastEvent(); reg = MessageServer <BroadcastEvent> .Intialize(be, ConfigurationManager.AppSettings["service2"], Convert.ToInt32(ConfigurationManager.AppSettings["port2"])); if (reg.Channels.Count > 0) { this.channel = reg.Channels[0];//.Find(a => a.ChannelName == ConfigurationManager.AppSettings["service2"]); } be.Channel = this.channel; if (reg.Uris.Count > 0) { this.uri = reg.Uris.Find(a => a.Segments[a.Segments.Length - 1] == ConfigurationManager.AppSettings["service2"]); } }
/// <summary> /// 私人消息队列 /// </summary> public MessageQueueQuery() { messageNotifyEvent = new Dictionary <Guid, ConsumeEventHandler>(); messagesNotifyEvent = new Dictionary <Guid, ConsumingEventHandler>(); List <BaseMessage> oldMsgs = GetAllMessages(); foreach (BaseMessage msg in oldMsgs) { this.Add(msg.ID, msg); } BroadcastEvent be = new BroadcastEvent(); reg = MessageServer <BroadcastEvent> .Intialize(be, ConfigurationManager.AppSettings["service2"], Convert.ToInt32(ConfigurationManager.AppSettings["port2"])); if (reg.Channels.Count > 0) { this.channel = reg.Channels[0];//.Find(a => a.ChannelName == ConfigurationManager.AppSettings["service2"]); } be.Channel = this.channel; if (reg.Uris.Count > 0) { this.uri = reg.Uris.Find(a => a.Segments[a.Segments.Length - 1] == ConfigurationManager.AppSettings["service2"]); } }