private void OnFrontendReady(object sender, NetMQSocketEventArgs e) { Codec.Receive(m_frontend); if (Codec.Id == Codec.MessageId.Message) { Service service; if (!m_services.TryGetValue(Codec.Message.Service, out service)) { // TODO: we should return error or save the message until a service become available } else { // Add the routing id as the client id and send to correct service Codec.Message.ConnectionId = RouterUtility.ConvertRoutingIdToConnectionId(Codec.RoutingId); Codec.RoutingId = service.GetNextRoutingId(); Codec.Send(m_backend); } } }
private Task <object> HandleRequestAsync(byte[] routingId, ulong messageId, string service, object message) { return(m_asyncHandler.HandleRequestAsync(messageId, RouterUtility.ConvertRoutingIdToConnectionId(routingId), service, message)); }
private void HandleOneWay(byte[] routingId, ulong messageId, string service, object message) { m_asyncHandler.HandleOneWay(messageId, RouterUtility.ConvertRoutingIdToConnectionId(routingId), service, message); }