public void Append_WithMockServer_Succeeds()
 {
     var logEventInfo = new LogEventInfo(LogLevel.Debug, "logger", "message");
     var nLogEventAdapter = new NLogEventAdapter("message", logEventInfo);
     using (var thriftClient = new ThriftClient("localhost", 9090))
     {
         thriftClient.Append(nLogEventAdapter);
     }
 }
        public static IFlumeClient CreateClient()
        {
            if (_clientType == ClientType.Thrift)
            {
                if (_client == null || _client.IsClosed)
                {
                    _client = new ThriftClient(_host, _port);
                }

                return _client;
            }

            throw new NotSupportedException(
                string.Format(CultureInfo.InvariantCulture,
                              "The client type [{0}] is not supported. The only supported type is Thrift.",
                              _clientType));
        }
        public static IFlumeClient CreateClient()
        {
            if (_client == null || _client.IsClosed)
            {
                switch (_clientType)
                {
                    case ClientType.LegacyThrift:
                        _client = new LegacyThriftClient(_host, _port);
                        break;

                    case ClientType.Thrift:
                        _client = new Thrift.ThriftClient(_host, _port);
                        break;

                    default:
                        throw new NotSupportedException(
                            string.Format(CultureInfo.InvariantCulture,
                                          "The client type [{0}] is not supported. The only supported type is Thrift.",
                                          _clientType));
                }
            }

            return _client;
        }
Esempio n. 4
0
        public static IFlumeClient CreateClient()
        {
            if (_client == null || _client.IsClosed)
            {
                switch (_clientType)
                {
                case ClientType.LegacyThrift:
                    _client = new LegacyThriftClient(_host, _port);
                    break;

                case ClientType.Thrift:
                    _client = new Thrift.ThriftClient(_host, _port);
                    break;

                default:
                    throw new NotSupportedException(
                              string.Format(CultureInfo.InvariantCulture,
                                            "The client type [{0}] is not supported. The only supported type is Thrift.",
                                            _clientType));
                }
            }

            return(_client);
        }