ApacheThrift 0.21.0

dotnet add package ApacheThrift --version 0.21.0                
NuGet\Install-Package ApacheThrift -Version 0.21.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ApacheThrift" Version="0.21.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ApacheThrift --version 0.21.0                
#r "nuget: ApacheThrift, 0.21.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ApacheThrift as a Cake Addin
#addin nuget:?package=ApacheThrift&version=0.21.0

// Install ApacheThrift as a Cake Tool
#tool nuget:?package=ApacheThrift&version=0.21.0                

Apache Thrift netstd

Thrift client library for Microsoft .NET Standard

Build the library

How to build on Windows

  • Get Thrift IDL compiler executable, add to some folder and add path to this folder into PATH variable.
  • Alternatively, build from source by using the cmake target "copy-thrift-compiler", which places the binary to a suitable place.
  • Open the Thrift.sln project with Visual Studio and build. or
  • Build with scripts

How to build on Unix/Linux

  • Ensure you have a suitable .NET Core SDK installed, or use the Ubuntu docker image
  • Follow common automake build practice: ./ bootstrap && ./ configure && make

Known issues

  • In trace logging mode you can see some not important internal exceptions

Migration to netstd

... from netcore

If you are migrating your code from netcore library, you will have to:

  • Switch to thrift -gen netstd
  • the following compiler flags are no longer needed or supported: hashcode is now standard, while nullable is no longer supported.
  • the Thrift.Transport and Thrift.Protocol namespaces now use the singular form
  • add using Thrift.Processor; in the server code where appropriate
  • rename all T*ClientTransport to T*Transport
  • rename all TBaseServer occurrences in your code to TServer
  • the SingletonTProcessorFactory is now called TSingletonProcessorFactory
  • and the AsyncBaseServer is now the TSimpleAsyncServer

You may wonder why we changed so many names. The naming scheme has been revised for two reasons: First, we want to get back the established, well-known naming consistency across the Thrift libraries which the netcore library did not fully respect. Second, by achieving that first objective, we get the additional benefit of making migration at least a bit easier for C# projects.

... from csharp

Because of the different environment requirements, migration from C# takes slightly more efforts. While the code changes related to Thrift itself are moderate, you may need to upgrade certain dependencies, components or even modules to more recent versions.

  1. Client and server applications must use at least framework 4.6.1, any version below will not work.
  2. Switch to thrift -gen netstd. The following compiler flags are no longer needed or supported: hashcode and async are now standard, while nullable is no longer supported.
  3. Familiarize yourself with the async/await model, if you have not already done so. As netstd does not support ISync anymore, async is mandatory. The synchronous model is simply no longer available (that's also the reason why we don't need the async flag anymore).
  4. Consider proper use of cancellationToken parameters. They are optional but may be quite helpful.
  5. As you probably already guessed, there are a few names that have been changed:
  • add using Thrift.Processor; in the server code where appropriate
  • the TServerSocket is now called TServerSocketTransport
  • change IProtocolFactory into ITProtocolFactory
  • if you are looking for TSimpleServer, try TSimpleAsyncServer instead
  • similarly, the TThreadPoolServer is now a TThreadPoolAsyncServer
  • the server's Serve() method does now ServeAsync()
  • In case you are using Thrift server event handlers: the SetEventHandler method now starts with an uppercase letter
  • and you will also have to revise the method names of all TServerEventHandler descendants you have in your code
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (28)

Showing the top 5 NuGet packages that depend on ApacheThrift:

Package Downloads
Jaeger.Communication.Thrift

Package Description

Logary.Targets.Zipkin

Logary is a high performance, multi-target logging, metric and health-check library for mono and .Net.

FsShelter

F# DSL and runtime for Apache Storm topologies

Zipkin.Core

A minimalistic .NET client library for Twitter Zipkin tracing.

Logary.Zipkin

Logary is a high performance, multi-target logging, metric and health-check library for mono and .Net.

GitHub repositories (5)

Showing the top 5 popular GitHub repositories that depend on ApacheThrift:

Repository Stars
fanliang11/surging
Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline. support Event-based Asynchronous Pattern and reactive programming ,The service engine supports http, TCP, WS,Grpc, Thrift,Mqtt, UDP, and DNS protocols. It uses ZooKeeper and Consul as a registry, and integrates it. Hash, random, polling, Fair Polling as a load balancing algorithm, built-in service governance to ensure reliable RPC communication, the engine contains Diagnostic, link tracking for protocol and middleware calls, and integration SkyWalking Distributed APM
apache/arrow-adbc
Database connectivity API standard and libraries for Apache Arrow
jaegertracing/jaeger-client-csharp
🛑 This library is DEPRECATED!
huynhsontung/Indirect
UWP Instagram Direct Message Client
hazelcast/hazelcast-csharp-client
Hazelcast .NET Client