mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 13:02:51 +08:00

* #580 added failing test * #580 added failing test for dynamic reroutes * #580 added failing test for validator * #580 validation tests passing * #580 acceptance tests passing * #580 got rid of the list in sdp factory * +semver: breaking #580 service discovery provider returned by delegate must be the same as name in config, this is a breaking change because you have to specify consul now * #580 removed use servide discovery property from file config, we dont need it, just use the service name as indicator the user wants to use service discovery for the given reroute
43 lines
1.7 KiB
ReStructuredText
43 lines
1.7 KiB
ReStructuredText
Service Fabric
|
|
==============
|
|
|
|
If you have services deployed in Service Fabric you will normally use the naming service to access them.
|
|
|
|
The following example shows how to set up a ReRoute that will work in Service Fabric. The most important thing is the ServiceName which is made up of the
|
|
Service Fabric application name then the specific service name. We also need to set up the ServiceDiscoveryProvider in
|
|
GlobalConfiguration. The example here shows a typical configuration. It assumes service fabric is running on localhost and that the naming service is on port 19081.
|
|
|
|
The example below is taken from the samples folder so please check it if this doesnt make sense!
|
|
|
|
.. code-block:: json
|
|
|
|
{
|
|
"ReRoutes": [
|
|
{
|
|
"DownstreamPathTemplate": "/api/values",
|
|
"UpstreamPathTemplate": "/EquipmentInterfaces",
|
|
"UpstreamHttpMethod": [
|
|
"Get"
|
|
],
|
|
"DownstreamScheme": "http",
|
|
"ServiceName": "OcelotServiceApplication/OcelotApplicationService",
|
|
}
|
|
],
|
|
"GlobalConfiguration": {
|
|
"RequestIdKey": "OcRequestId",
|
|
"ServiceDiscoveryProvider": {
|
|
"Host": "localhost",
|
|
"Port": 19081,
|
|
"Type": "ServiceFabric"
|
|
}
|
|
}
|
|
}
|
|
|
|
If you are using stateless / guest exe services ocelot will be able to proxy through the naming service without anything else. However
|
|
if you are using statefull / actor services you must send the PartitionKind and PartitionKey query string values with the client
|
|
request e.g.
|
|
|
|
GET http://ocelot.com/EquipmentInterfaces?PartitionKind=xxx&PartitionKey=xxx
|
|
|
|
There is no way for Ocelot to work these out for you.
|