private void Handle(ClientMessage.CreateStream message) { _outputBus.Publish(new ReplicationMessage.CreateStreamRequestCreated(message.CorrelationId, message.Envelope, message.EventStreamId, message.Metadata)); }
public TcpPackage CreateNetworkPackage() { lock (_corrIdLock) { var dto = new ClientMessage.CreateStream(_stream, _metadata, _forward, _isJson); return(new TcpPackage(TcpCommand.CreateStream, _correlationId, dto.Serialize())); } }
private void CreateStreamBodyRead(HttpEntityManager manager, string body) { var entity = manager.HttpEntity; var create = entity.RequestCodec.From <ClientMessageDto.CreateStreamText>(body); if (create == null) { SendBadRequest(entity, "Create stream request body cannot be deserialized"); return; } var envelope = new SendToHttpEnvelope(entity, Format.Atom.CreateStreamCompleted, Configure.CreateStreamCompleted); var msg = new ClientMessage.CreateStream(create.CorrelationId == Guid.Empty ? Guid.NewGuid() : create.CorrelationId, envelope, create.EventStreamId, Encoding.UTF8.GetBytes(create.Metadata ?? string.Empty)); Publish(msg); }
private static TcpPackage WrapCreateStream(ClientMessage.CreateStream msg) { var dto = new ClientMessageDto.CreateStream(msg.CorrelationId, msg.EventStreamId, msg.Metadata); return(new TcpPackage(TcpCommand.CreateStream, msg.CorrelationId, dto.Serialize())); }