I want to implement TCP connection between Stateless and Stateful service. I want to know what is the best way to implement this. Stateless service will send some data frequently to stateful service. Stateful service will process this data and store into state. We are going to have another Stateless Web API that will talk to this stateful service using a Get() method to get the data.
below is my flow for call.
stateless Service -> Stateful Service -> Stateless Web Api -> Web App
If you want to communicate directly with a service (directly because you don't really do that in a clustered environment as a service may move from machine to machine and change IP) then the service can implement one or most listeners to create an endpoint to access via whatever protocol you think is best (e.g. HTTP). Then, you can use the client libraries to communicate with that service. For more detail, see https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-services-communication
Alternatively you could communicate between services indirectly. You could use Azure Storage Queues or Service Bus to communicate over queues--which is useful in an elastic environment because sender and receiver and work at different speeds without causing too much of an issue.