public Consumer(string id, string groupName, ConsumerSetting setting) { if (id == null) { throw new ArgumentNullException("id"); } if (groupName == null) { throw new ArgumentNullException("groupName"); } Id = id; GroupName = groupName; Setting = setting ?? new ConsumerSetting(); _lockObject = new object(); _subscriptionTopics = new List<string>(); _topicQueuesDict = new ConcurrentDictionary<string, IList<MessageQueue>>(); _pullRequestQueue = new BlockingCollection<PullRequest>(new ConcurrentQueue<PullRequest>()); _pullRequestDict = new ConcurrentDictionary<string, PullRequest>(); _consumingMessageQueue = new BlockingCollection<ConsumingMessage>(new ConcurrentQueue<ConsumingMessage>()); _messageRetryQueue = new BlockingCollection<ConsumingMessage>(new ConcurrentQueue<ConsumingMessage>()); _handlingMessageDict = new ConcurrentDictionary<long, ConsumingMessage>(); _taskIds = new List<int>(); _remotingClient = new SocketRemotingClient(Setting.BrokerAddress, Setting.BrokerPort); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _scheduleService = ObjectContainer.Resolve<IScheduleService>(); _allocateMessageQueueStragegy = ObjectContainer.Resolve<IAllocateMessageQueueStrategy>(); _executePullRequestWorker = new Worker("Consumer.ExecutePullRequest", ExecutePullRequest); _handleMessageWorker = new Worker("Consumer.HandleMessage", HandleMessage); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName); }
public MessageService(IBinarySerializer binarySerializer) { _remotingClient = new SocketRemotingClient(Settings.BrokerAddress, Settings.BrokerPort); _remotingClient.Connect(); _remotingClient.Start(); _binarySerializer = binarySerializer; }
public ClientService(ClientSetting setting, Producer producer, Consumer consumer) { Ensure.NotNull(setting, "setting"); if (producer == null && consumer == null) { throw new ArgumentException("producer or consumer must set at least one of them."); } else if (producer != null && consumer != null) { throw new ArgumentException("producer or consumer cannot set both of them."); } Interlocked.Increment(ref _instanceNumber); _producer = producer; _consumer = consumer; _setting = setting; _clientId = BuildClientId(setting.ClientName); _brokerConnectionDict = new ConcurrentDictionary<string, BrokerConnection>(); _topicMessageQueueDict = new ConcurrentDictionary<string, IList<MessageQueue>>(); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _jsonSerializer = ObjectContainer.Resolve<IJsonSerializer>(); _scheduleService = ObjectContainer.Resolve<IScheduleService>(); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName); _nameServerRemotingClientList = RemotingClientUtils.CreateRemotingClientList(_setting.NameServerList, _setting.SocketSetting).ToList(); }
EventStoreHolder(IHostConfiguration configuration, IBinarySerializer serializer) { var ipEndpoint = new IPEndPoint(configuration.EventStoreIp, configuration.EventStorePort); _connection = EventStoreConnection.Create(ipEndpoint); _serializer = serializer; }
public QueryConsumerInfoRequestHandler() { _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _offsetStore = ObjectContainer.Resolve<IConsumeOffsetStore>(); _consumerManager = ObjectContainer.Resolve<ConsumerManager>(); _queueService = ObjectContainer.Resolve<IQueueStore>(); }
public Consumer(string groupName, ConsumerSetting setting) { if (groupName == null) { throw new ArgumentNullException("groupName"); } GroupName = groupName; Setting = setting ?? new ConsumerSetting(); _lockObject = new object(); _subscriptionTopics = new Dictionary<string, HashSet<string>>(); _topicQueuesDict = new ConcurrentDictionary<string, IList<MessageQueue>>(); _pullRequestQueue = new BlockingCollection<PullRequest>(new ConcurrentQueue<PullRequest>()); _pullRequestDict = new ConcurrentDictionary<string, PullRequest>(); _messageRetryQueue = new BlockingCollection<ConsumingMessage>(new ConcurrentQueue<ConsumingMessage>()); _taskFactory = new TaskFactory(new LimitedConcurrencyLevelTaskScheduler(Setting.ConsumeThreadMaxCount)); _remotingClient = new SocketRemotingClient(Setting.BrokerAddress, Setting.SocketSetting, Setting.LocalAddress); _adminRemotingClient = new SocketRemotingClient(Setting.BrokerAdminAddress, Setting.SocketSetting, Setting.LocalAdminAddress); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _scheduleService = ObjectContainer.Resolve<IScheduleService>(); _allocateMessageQueueStragegy = ObjectContainer.Resolve<IAllocateMessageQueueStrategy>(); _executePullRequestWorker = new Worker("ExecutePullRequest", ExecutePullRequest); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName); _remotingClient.RegisterConnectionEventListener(new ConnectionEventListener(this)); }
public SendMessageRequestHandler(BrokerController brokerController) { _brokerController = brokerController; _messageService = ObjectContainer.Resolve<IMessageService>(); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().Name); }
public Consumer(string groupName, ConsumerSetting setting, string consumerName = null) { if (groupName == null) { throw new ArgumentNullException("groupName"); } Name = consumerName; GroupName = groupName; Setting = setting ?? new ConsumerSetting(); if (Setting.NameServerList == null || Setting.NameServerList.Count() == 0) { throw new Exception("Name server address is not specified."); } _subscriptionTopics = new Dictionary<string, HashSet<string>>(); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName); var clientSetting = new ClientSetting { ClientName = Name, ClusterName = Setting.ClusterName, NameServerList = Setting.NameServerList, SocketSetting = Setting.SocketSetting, OnlyFindMasterBroker = true, SendHeartbeatInterval = Setting.HeartbeatBrokerInterval, RefreshBrokerAndTopicRouteInfoInterval = Setting.RefreshBrokerAndTopicRouteInfoInterval }; _clientService = new ClientService(clientSetting, null, this); _pullMessageService = new PullMessageService(this, _clientService); _commitConsumeOffsetService = new CommitConsumeOffsetService(this, _clientService); _rebalanceService = new RebalanceService(this, _clientService, _pullMessageService, _commitConsumeOffsetService); }
public Consumer(string groupName, ConsumerSetting setting) { if (groupName == null) { throw new ArgumentNullException("groupName"); } GroupName = groupName; Setting = setting ?? new ConsumerSetting(); _lockObject = new object(); _subscriptionTopics = new Dictionary<string, HashSet<string>>(); _topicQueuesDict = new ConcurrentDictionary<string, IList<MessageQueue>>(); _pullRequestDict = new ConcurrentDictionary<string, PullRequest>(); _remotingClient = new SocketRemotingClient(Setting.BrokerAddress, Setting.SocketSetting, Setting.LocalAddress); _adminRemotingClient = new SocketRemotingClient(Setting.BrokerAdminAddress, Setting.SocketSetting, Setting.LocalAdminAddress); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _scheduleService = ObjectContainer.Resolve<IScheduleService>(); _allocateMessageQueueStragegy = ObjectContainer.Resolve<IAllocateMessageQueueStrategy>(); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName); _remotingClient.RegisterConnectionEventListener(new ConnectionEventListener(this)); if (Setting.MessageHandleMode == MessageHandleMode.Sequential) { _consumingMessageQueue = new BlockingCollection<ConsumingMessage>(); _consumeMessageWorker = new Worker("ConsumeMessage", () => HandleMessage(_consumingMessageQueue.Take())); } _messageRetryQueue = new BlockingCollection<ConsumingMessage>(); }
public QueryTopicConsumeInfoRequestHandler() { _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _offsetManager = ObjectContainer.Resolve<IOffsetManager>(); _queueService = ObjectContainer.Resolve<IQueueService>(); _consumerManager = ObjectContainer.Resolve<ConsumerManager>(); }
public EventPublisher(ProducerSetting setting, string id) { _producer = new Producer(setting, id); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _eventTopicProvider = ObjectContainer.Resolve<IEventTopicProvider>(); _eventTypeCodeProvider = ObjectContainer.Resolve<IEventTypeCodeProvider>(); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().Name); }
public MessageService(IBinarySerializer binarySerializer, IScheduleService scheduleService, SendEmailService sendEmailService) { _nameServerRemotingClientList = CreateRemotingClientList(Settings.NameServerList); _clusterBrokerDict = new ConcurrentDictionary<string, IList<BrokerClient>>(); _binarySerializer = binarySerializer; _scheduleService = scheduleService; _sendEmailService = sendEmailService; }
/// <summary>Parameterized constructor. /// </summary> public SqlServerEventStore(string connectionString, string eventTable, string commitIndexName, string versionIndexName) { _connectionString = connectionString; _eventTable = eventTable; _commitIndexName = commitIndexName; _versionIndexName = versionIndexName; _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _connectionFactory = ObjectContainer.Resolve<IDbConnectionFactory>(); }
/// <summary> /// Ctor /// </summary> /// <param name="serviceEvents">ServiceEvents</param> /// <param name="listenerFactory">KafkaListener factory</param> /// <param name="serializer">Binary serializer</param> public KafkaHostListener( IServiceEvents serviceEvents, IKafkaListenerFactory listenerFactory, IBinarySerializer serializer) { _serviceEvents = serviceEvents; _listenerFactory = listenerFactory; _serializer = serializer; }
public CommandService(CommandResultProcessor commandResultProcessor, ProducerSetting setting, string id) { _commandResultProcessor = commandResultProcessor; _producer = new Producer(setting, id); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _commandTopicProvider = ObjectContainer.Resolve<ICommandTopicProvider>(); _commandTypeCodeProvider = ObjectContainer.Resolve<ICommandTypeCodeProvider>(); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().Name); }
public ClusterManager(NameServerController nameServerController) { _scheduleService = ObjectContainer.Resolve<IScheduleService>(); _jsonSerializer = ObjectContainer.Resolve<IJsonSerializer>(); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _clusterDict = new ConcurrentDictionary<string, Cluster>(); _nameServerController = nameServerController; _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName); }
public MessageService(IBinarySerializer binarySerializer, IScheduleService scheduleService, SendEmailService sendEmailService) { _remotingClient = new SocketRemotingClient(Settings.BrokerAddress); _binarySerializer = binarySerializer; _scheduleService = scheduleService; _unconsumedMessageWarnningThreshold = int.Parse(ConfigurationManager.AppSettings["unconsumedMessageWarnningThreshold"]); _checkUnconsumedMessageInterval = int.Parse(ConfigurationManager.AppSettings["checkUnconsumedMessageInterval"]); _sendEmailService = sendEmailService; }
public EventConsumer(string id, ConsumerSetting setting, string groupName, DomainEventHandledMessageSender domainEventHandledMessageSender) { _consumer = new Consumer(id, setting, string.IsNullOrEmpty(groupName) ? typeof(EventConsumer).Name + "Group" : groupName); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _eventTypeCodeProvider = ObjectContainer.Resolve<IEventTypeCodeProvider>(); _eventProcessor = ObjectContainer.Resolve<IEventProcessor>(); _messageContextDict = new ConcurrentDictionary<string, IMessageContext>(); _domainEventHandledMessageSender = domainEventHandledMessageSender; }
public CommitConsumeOffsetService(Consumer consumer, ClientService clientService) { _consumeOffsetInfoDict = new ConcurrentDictionary<string, ConsumeOffsetInfo>(); _consumer = consumer; _clientService = clientService; _clientId = clientService.GetClientId(); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _scheduleService = ObjectContainer.Resolve<IScheduleService>(); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName); }
public PullMessageRequestHandler() { _consumerManager = ObjectContainer.Resolve<ConsumerManager>(); _suspendedPullRequestManager = ObjectContainer.Resolve<SuspendedPullRequestManager>(); _messageService = ObjectContainer.Resolve<IMessageService>(); _queueService = ObjectContainer.Resolve<IQueueService>(); _offsetManager = ObjectContainer.Resolve<IOffsetManager>(); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName); EmptyResponseData = new byte[0]; }
public RequestChannel( CommunicateChannelFactoryPool channelFactoryPool, RequestMessageContext requestMessageContext, IBinarySerializer binarySerializer) { _requestMessageContext = requestMessageContext; _channelFactoryPool = channelFactoryPool; _binarySerializer = binarySerializer; }
public CommandResultProcessor(Consumer commandExecutedMessageConsumer, Consumer domainEventHandledMessageConsumer) { _commandExecutedMessageConsumer = commandExecutedMessageConsumer; _domainEventHandledMessageConsumer = domainEventHandledMessageConsumer; _commandTaskDict = new ConcurrentDictionary<string, CommandTaskCompletionSource>(); _processTaskDict = new ConcurrentDictionary<string, TaskCompletionSource<ProcessResult>>(); _commandExecutedMessageLocalQueue = new BlockingCollection<CommandExecutedMessage>(new ConcurrentQueue<CommandExecutedMessage>()); _domainEventHandledMessageLocalQueue = new BlockingCollection<DomainEventHandledMessage>(new ConcurrentQueue<DomainEventHandledMessage>()); _commandExecutedMessageWorker = new Worker(() => ProcessExecutedCommandMessage(_commandExecutedMessageLocalQueue.Take())); _domainEventHandledMessageWorker = new Worker(() => ProcessDomainEventHandledMessage(_domainEventHandledMessageLocalQueue.Take())); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); }
public Consumer(string id, ConsumerSetting setting, string groupName) { Id = id; Setting = setting ?? new ConsumerSetting(); GroupName = groupName; _remotingClient = new SocketRemotingClient(Setting.BrokerAddress, Setting.BrokerPort); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _scheduleService = ObjectContainer.Resolve<IScheduleService>(); _offsetStore = Setting.MessageModel == MessageModel.Clustering ? ObjectContainer.Resolve<IRemoteBrokerOffsetStore>() as IOffsetStore : ObjectContainer.Resolve<ILocalOffsetStore>() as IOffsetStore; _allocateMessageQueueStragegy = ObjectContainer.Resolve<IAllocateMessageQueueStrategy>(); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().Name); }
public Producer(ProducerSetting setting, string id) { Id = id; Setting = setting ?? new ProducerSetting(); _topicQueueCountDict = new ConcurrentDictionary<string, int>(); _taskIds = new List<int>(); _remotingClient = new SocketRemotingClient(Setting.BrokerAddress, Setting.BrokerPort); _scheduleService = ObjectContainer.Resolve<IScheduleService>(); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _queueSelector = ObjectContainer.Resolve<IQueueSelector>(); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().Name); }
/// <summary>Parameterized constructor. /// </summary> /// <param name="connectionString"></param> /// <exception cref="ArgumentNullException"></exception> public MongoEventStore(string connectionString) { if (string.IsNullOrEmpty(connectionString)) { throw new ArgumentNullException("connectionString"); } _connectionString = connectionString; _eventCollectionNameProvider = ObjectContainer.Resolve<IEventCollectionNameProvider>(); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _aggregateRootTypeProvider = ObjectContainer.Resolve<IAggregateRootTypeProvider>(); }
public RebalanceService(Consumer consumer, ClientService clientService, PullMessageService pullMessageService, CommitConsumeOffsetService commitConsumeOffsetService) { _consumer = consumer; _clientService = clientService; _clientId = clientService.GetClientId(); _pullRequestDict = new ConcurrentDictionary<string, PullRequest>(); _allocateMessageQueueStragegy = ObjectContainer.Resolve<IAllocateMessageQueueStrategy>(); _pullMessageService = pullMessageService; _commitConsumeOffsetService = commitConsumeOffsetService; _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _scheduleService = ObjectContainer.Resolve<IScheduleService>(); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName); }
public DefaultCommandProssor( IEventStore eventStore, IRepository repository, CommandHandleProvider commandHandleProvider, IEventPublisher eventPublisher, ISnapshotStorage snapshotStorage, IBinarySerializer binarySerializer) { _eventStore = eventStore; _repository = repository; _commandHandleProvider = commandHandleProvider; _eventPublisher = eventPublisher; _binarySerializer = binarySerializer; _snapshotStorage = snapshotStorage; }
public PushMessageConsumer( CommunicateChannelFactoryPool channelPools, IBinarySerializer binarySerializer, ConsumerContext consumerContext, IQueueMessageHandler messageHandler) { _channelPools = channelPools; _consumerContext = consumerContext; _messageHandler = messageHandler; _binarySerializer = binarySerializer; _cancellation = new CancellationTokenSource(); }
/// <summary> /// Parameterized constructor. /// </summary> public EventSourcedRepository(IEventStore eventStore, ISnapshotStore snapshotStore, ISnapshotPolicy snapshotPolicy, IMemoryCache cache, IEventBus eventBus, IAggregateRootFactory aggregateFactory, IBinarySerializer binarySerializer) { this._eventStore = eventStore; this._snapshotStore = snapshotStore; this._snapshotPolicy = snapshotPolicy; this._cache = cache; this._eventBus = eventBus; this._aggregateFactory = aggregateFactory; this._binarySerializer = binarySerializer; //this._textSerializer = textSerializer; this._logger = LogManager.GetLogger("ThinkNet"); }
public Producer(string id, ProducerSetting setting) { if (id == null) { throw new ArgumentNullException("id"); } Id = id; Setting = setting ?? new ProducerSetting(); _lockObject = new object(); _taskIds = new List<int>(); _topicQueueIdsDict = new ConcurrentDictionary<string, IList<int>>(); _remotingClient = new SocketRemotingClient(Setting.BrokerAddress, Setting.BrokerPort); _scheduleService = ObjectContainer.Resolve<IScheduleService>(); _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>(); _queueSelector = ObjectContainer.Resolve<IQueueSelector>(); _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName); }
private int SetUInt16Value(IBinarySerializer serializer, BinaryWriter writer, object value) { writer.Write((ushort)value); return(2); }
public DefaultSnapshotter(IAggregateRootFactory aggregateRootFactory, ITypeCodeProvider aggregateRootTypeCodeProvider, IBinarySerializer binarySerializer) { _aggregateRootFactory = aggregateRootFactory; _aggregateRootTypeCodeProvider = aggregateRootTypeCodeProvider; _binarySerializer = binarySerializer; }
public GetTopicQueueInfoRequestHandler() { _binarySerializer = ObjectContainer.Resolve <IBinarySerializer>(); _queueStore = ObjectContainer.Resolve <IQueueStore>(); _offsetStore = ObjectContainer.Resolve <IConsumeOffsetStore>(); }
public QueryProducerInfoRequestHandler() { _binarySerializer = ObjectContainer.Resolve <IBinarySerializer>(); _producerManager = ObjectContainer.Resolve <ProducerManager>(); }
protected override int SerializeExclusiveData(IBinarySerializer serializer, BinaryWriter writer, BinarySerializerSettings settings = null) { return(serializer.Serialize(Descriptors, writer, settings)); }
public ConsumerHeartbeatRequestHandler(BrokerController brokerController) { _consumerManager = ObjectContainer.Resolve <ConsumerManager>(); _binarySerializer = ObjectContainer.Resolve <IBinarySerializer>(); }
public GetTopicAccumulateInfoListRequestHandler(NameServerController nameServerController) { _clusterManager = nameServerController.ClusterManager; _binarySerializer = ObjectContainer.Resolve <IBinarySerializer>(); }
public DisableQueueRequestHandler() { _binarySerializer = ObjectContainer.Resolve <IBinarySerializer>(); _queueService = ObjectContainer.Resolve <IQueueService>(); }
/// <summary> /// Handles the serialization using the specified serializer /// </summary> /// <param name="s">The serializer</param> public void Serialize(IBinarySerializer s) { Data = s.SerializeArray <byte>(Data, 17, name: nameof(Data)); }
/// <summary> /// Deserialize logic /// </summary> /// <param name="deserializer">Deserializer</param> /// <param name="reader">Reader</param> /// <param name="settings">Settings</param> /// <returns>How many bytes have been written</returns> protected virtual void DeserializeExclusiveData(IBinarySerializer deserializer, BinaryReader reader, BinarySerializerSettings settings = null) { }
/// <summary> /// Serialize logic /// </summary> /// <param name="serializer">Serializer</param> /// <param name="writer">Writer</param> /// <param name="settings">Settings</param> /// <returns>How many bytes have been written</returns> protected virtual int SerializeExclusiveData(IBinarySerializer serializer, BinaryWriter writer, BinarySerializerSettings settings = null) { return(0); }
public SetQueueNextConsumeOffsetForClusterRequestHandler(NameServerController nameServerController) { _binarySerializer = ObjectContainer.Resolve <IBinarySerializer>(); _nameServerController = nameServerController; }
public int Serialize(IBinarySerializer serializer, BinaryWriter writer, object value, BinarySerializerSettings settings = null) { writer.Write((short)value); return(2); }
public object Deserialize(IBinarySerializer deserializer, BinaryReader reader, Type type, BinarySerializerSettings settings = null) { return(reader.ReadInt16()); }
public History(IBinarySerializer serializer) { this._serializer = serializer; }
public GetConsumerListRequestHandler() { _binarySerializer = ObjectContainer.Resolve <IBinarySerializer>(); _getConsumerListService = ObjectContainer.Resolve <GetConsumerListService>(); }
/// <summary> /// Parameterized constructor. /// </summary> public DefaultMemoryCache(IBinarySerializer serializer) { this._serializer = serializer; this._enabled = ConfigurationManager.AppSettings["thinkcfg.caching_enabled"].Safe("false").ToBoolean(); }
private int SetUInt32Value(IBinarySerializer serializer, BinaryWriter writer, object value) { writer.Write((uint)value); return(4); }
//Use BinaryInitializer to inject IBinarySerializer public static void Initialize(IBinarySerializer binarySerializer) { Default = binarySerializer; }
private int SetUInt64Value(IBinarySerializer serializer, BinaryWriter writer, object value) { writer.Write((ulong)value); return(8); }
public GetMessageDetailRequestHandler() { _messageStore = ObjectContainer.Resolve <IMessageStore>(); _binarySerializer = ObjectContainer.Resolve <IBinarySerializer>(); }
public RedisMemoryCache(string host, int port) { _redisClient = new RedisClient(host, port); _binarySerializer = ObjectContainer.Resolve <IBinarySerializer>(); }
public void Serialize(IBinarySerializer serializer) { serializer.Write(ExecutorId); serializer.Write(ExecutorApiKey); }
public DeleteTopicRequestHandler() { _binarySerializer = ObjectContainer.Resolve <IBinarySerializer>(); _queueStore = ObjectContainer.Resolve <IQueueStore>(); }
public int SetRecursiveValue(IBinarySerializer serializer, BinaryWriter writer, object value) { return(serializer.Serialize(value, writer)); }
public SetQueueProducerVisibleRequestHandler() { _binarySerializer = ObjectContainer.Resolve <IBinarySerializer>(); _queueStore = ObjectContainer.Resolve <IQueueStore>(); }
public DeleteQueueForClusterRequestHandler(NameServerController nameServerController) { _binarySerializer = ObjectContainer.Resolve <IBinarySerializer>(); _nameServerController = nameServerController; }
/// <summary> /// /// </summary> /// <param name="binarySerializer"></param> /// <param name="encoding">对value为string类型的直接使用Encoding.GetBytes</param> public BinaryCompressProtocol(IBinarySerializer binarySerializer, Encoding encoding) { this.binarySerializer = binarySerializer; this.Encoding = encoding; }
private int SetDoubleValue(IBinarySerializer serializer, BinaryWriter writer, object value) { writer.Write((double)value); return(8); }
private int SetSByteValue(IBinarySerializer serializer, BinaryWriter writer, object value) { writer.Write((sbyte)value); return(1); }