Example #1
0
 public Producer(string uri, ProducerConfigInfo producerConfigInfo)
 {
     this.lockObj            = new object();
     this.uri                = uri;
     this.producerConfigInfo = producerConfigInfo;
     // this.wapper = (ILocalMessageWapper)new DefaultLocalMessageWapper(producerConfigInfo.ExchangeName);
 }
Example #2
0
        public IModel CreateProducerChannelByConfig(ProducerConfigInfo producerConfigInfo)
        {
            IModel channel = this.CreateChannel();

            IModelExensions.ExchangeDeclare(channel, producerConfigInfo.ExchangeName, producerConfigInfo.ExchangeTypeCode, producerConfigInfo.ExchangeDurable, false, (IDictionary <string, object>)null);
            return(channel);
        }
Example #3
0
 private void SaveException(
     string message,
     string routingKey,
     ProducerConfigInfo producerConfigInfo,
     BasicPropertiesConfigInfo basicPropertiesConfigInfo)
 {
     this.exceptionStatus = Producer.ExceptionStatus.Exception;
     try
     {
         //this.wapper.Write(new MessageLocal()
         //{
         //    Message = message,
         //    RoutingKey = routingKey,
         //    BasicPropertiesConfigInfo = basicPropertiesConfigInfo,
         //    ProducerConfigInfo = producerConfigInfo
         //});
     }
     catch (Exception ex)
     {
         //  RecordLog.WriteLog("ExchangeName:" + producerConfigInfo.ExchangeName + ",RoutingKey:" + routingKey + ",Message:" + message + ",SaveException", producerConfigInfo.ExchangeName, routingKey, "", ex);
         throw ex;
     }
 }