Ejemplo n.º 1
0
        IQueueAck ExecRout(QueueItem item, QueueHost qh)
        {
            if (qh == null)
            {
                throw new MessageException(MessageState.InvalidMessageHost, "Invalid QueueHost for Routing " + item.Host);
            }
            IQueueAck ack = null;

            if (qh.IsLocal)
            {
                item.Host = qh.HostName;
                MQueue Q = Get(item.Host);
                if (Q == null)
                {
                    throw new MessageException(MessageState.InvalidMessageHost, "message.RoutHostName not found " + item.Host);
                }
                ack = Q.Enqueue(item);
                return(ack);// ptr.MessageState;
            }

            var api = QueueApi.Get(qh.NetProtocol);

            ack = api.SendAsync(item, 0);
            return(ack);
        }
Ejemplo n.º 2
0
 public void SendSubscriber(TopicSubscriber subscriber, QueueItem item)
 {
     try
     {
         var api = QueueApi.Get(subscriber.Protocol);
         //var message = item.ToMessage();// Message.Create(item.GetItemStream());
         api.Send(item);
     }
     catch (Exception ex)
     {
         Netlog.Exception("Topic Sender Subscriber error ", ex);
     }
 }