コード例 #1
0
        public async Task <IHttpActionResult> ReceiveMessageA(FirstResponseInbound message)
        {
            _logger.Info($"Received message (a): {JsonConvert.SerializeObject(message)}");
            var mapped = new FirstResponse
            {
                Balance = message.Balance,
                Id      = Guid.Parse(message.SomeIdentifier)
            };
            const string queue = QueueNames.Inbound;

            _logger.Info($"Publishing notification to queue '{queue}'");
            await _subscriptionManager.Publish(queue, mapped);

            return(Ok());
        }
コード例 #2
0
        public async Task <IHttpActionResult> ReceiveMessageA(FirstRequestOutbound request)
        {
            _logger.Info($"Received message (a): {JsonConvert.SerializeObject(request)}");
            var response = new FirstResponseInbound
            {
                Balance        = 0.25m,
                SomeIdentifier = request.SomeIdentifier
            };
            const string url = "http://localhost:9023/api/messages/a";

            _logger.Info($"Sending response - POST {url}");
            await _httpClient.PostAsJsonAsync(url, response);

            return(Ok());
        }