public bool ConsumeAddSubscription(AddSubscription addSubscription) { var newSubscription = AddSubscription(addSubscription.Type, addSubscription.Endpoint.Uri.ToString()); if (newSubscription) { var itemId = 0; pht.Batch(actions => { var stream = new MemoryStream(); messageSerializer.Serialize(new[] {addSubscription}, stream); itemId = actions.AddItem(new AddItemRequest { Key = subscriptionsKey, Data = stream.ToArray() }); actions.Commit(); }); AddMessageIdentifierForTracking( itemId, addSubscription.Type, addSubscription.Endpoint.Uri); return true; } return false; }
private bool ConsumeAddSubscription(CurrentMessageInformation msgInfo, AddSubscription addSubscription) { bool newSubscription = AddSubscription(addSubscription.Type, addSubscription.Endpoint); AddMessageIdentifierForTracking(msgInfo.MessageId.ToString(), addSubscription.Type, new Uri(addSubscription.Endpoint)); var msmqMsgInfo = msgInfo as MsmqCurrentMessageInformation; if (msmqMsgInfo != null && newSubscription) { queueStrategy.MoveToSubscriptionQueue(msmqMsgInfo.Queue, msmqMsgInfo.MsmqMessage); return true; } return false; }
private bool ConsumeAddSubscription(CurrentMessageInformation msgInfo, AddSubscription addSubscription) { bool newSubscription = AddSubscription(addSubscription.Type, addSubscription.Endpoint.Uri.ToString()); var msmqMsgInfo = msgInfo as MsmqCurrentMessageInformation; if (msmqMsgInfo != null && newSubscription) { Message message = msmqMsgInfo.MsmqMessage; msmqMsgInfo.Queue.Send( message.SetSubQueueToSendTo(SubQueue.Subscriptions)); AddMessageIdentifierForTracking( message.Id, addSubscription.Type, addSubscription.Endpoint.Uri); return true; } AddMessageIdentifierForTracking( msgInfo.TransportMessageId, addSubscription.Type, addSubscription.Endpoint.Uri); return false; }
public bool ConsumeAddSubscription(AddSubscription subscription) { return AddSubscription(subscription.Type, subscription.Endpoint.Uri.AbsoluteUri); }