private RestMSDomain CreatePipe(string domainUri, string title) { s_logger.LogDebug("Creating the pipe {0} on the RestMS server: {URL}", title, _gateway.Configuration.RestMS.Uri.AbsoluteUri); var client = _gateway.Client(); try { var response = client.SendAsync(_gateway.CreateRequest( domainUri, _gateway.CreateEntityBody( new RestMSPipeNew { Type = "Default", Title = title }) ) ) .Result; response.EnsureSuccessStatusCode(); return(_gateway.ParseResponse <RestMSDomain>(response)); } catch (AggregateException ae) { foreach (var exception in ae.Flatten().InnerExceptions) { s_logger.LogError(exception, "Threw exception adding Pipe {0} to RestMS Server {URL}", title, exception.Message); } throw new RestMSClientException(string.Format("Error adding the Feed {0} to the RestMS server, see log for details", title)); } }
private RestMSDomain CreateFeed(string domainUri, string name) { _logger.Value.DebugFormat("Creating the feed {0} on the RestMS server: {1}", name, _gateway.Configuration.RestMS.Uri.AbsoluteUri); var client = _gateway.Client(); try { var response = client.SendAsync(_gateway.CreateRequest( domainUri, _gateway.CreateEntityBody( new RestMSFeed { Name = name, Type = "Default", Title = name })) ).Result; response.EnsureSuccessStatusCode(); return(_gateway.ParseResponse <RestMSDomain>(response)); } catch (AggregateException ae) { foreach (var exception in ae.Flatten().InnerExceptions) { _logger.Value.ErrorFormat("Threw exception adding Feed {0} to RestMS Server {1}", name, exception.Message); } throw new RestMSClientException(string.Format("Error adding the Feed {0} to the RestMS server, see log for details", name)); } }
public RestMSJoin CreateJoin(string pipeUri, string routingKey) { _logger.Value.DebugFormat("Creating the join with key {0} for pipe {1}", routingKey, pipeUri); var client = _gateway.Client(); try { var response = client.SendAsync( _gateway.CreateRequest( pipeUri, _gateway.CreateEntityBody( new RestMSJoin { Address = routingKey, Feed = _feed.FeedUri, Type = "Default" } ) ) ) .Result; response.EnsureSuccessStatusCode(); var pipe = _gateway.ParseResponse <RestMSPipe>(response); return(pipe.Joins.FirstOrDefault()); } catch (AggregateException ae) { foreach (var exception in ae.Flatten().InnerExceptions) { _logger.Value.ErrorFormat("Threw exception adding join with routingKey {0} to Pipe {1} on RestMS Server {2}", routingKey, pipeUri, exception.Message); } throw new RestMSClientException(string.Format("Error adding the join with routingKey {0} to Pipe {1} to the RestMS server, see log for details", routingKey, pipeUri)); } }