protected virtual string DefaultSubscriptionIdGenerator(ConsumerInfo c) { var r = new StringBuilder(); var unique = string.Concat(SubscriptionIdPrefix, ":", c.ConcreteType.FullName, ":", c.MessageType.FullName); using (var md5 = MD5.Create()) { var buff = md5.ComputeHash(Encoding.UTF8.GetBytes(unique)); foreach (var b in buff) { r.Append(b.ToString("x2")); } } return(string.Concat(SubscriptionIdPrefix, ":", r.ToString())); }
protected virtual ConsumerAttribute GetSubscriptionAttribute(ConsumerInfo consumerInfo) { var consumeMethod = consumerInfo.ConcreteType.GetMethod(ConsumeMethodName, new[] { consumerInfo.MessageType }); return consumeMethod.GetCustomAttributes(typeof(ConsumerAttribute), true).SingleOrDefault() as ConsumerAttribute; }
protected virtual string DefaultSubscriptionIdGenerator(ConsumerInfo c) { var r = new StringBuilder(); var unique = string.Concat(SubscriptionIdPrefix, ":", c.ConcreteType.FullName, ":", c.MessageType.FullName); using (var md5 = MD5.Create()) { var buff = md5.ComputeHash(Encoding.UTF8.GetBytes(unique)); foreach (var b in buff) r.Append(b.ToString("x2")); } return string.Concat(SubscriptionIdPrefix, ":", r.ToString()); }
protected virtual ConsumerAttribute GetSubscriptionAttribute(ConsumerInfo consumerInfo) { var consumeMethod = consumerInfo.ConcreteType.GetMethod(ConsumeMethodName, new[] { consumerInfo.MessageType }); return(consumeMethod.GetCustomAttributes(typeof(ConsumerAttribute), true).SingleOrDefault() as ConsumerAttribute); }
protected virtual MethodInfo GetConsumeMethodFor(ConsumerInfo subscriptionInfo) { return(subscriptionInfo.ConcreteType.GetMethod(ConsumeMethodName, new[] { subscriptionInfo.MessageType })); }