Container-to-container discovery and communication

The PortBinding element is also used to map a port to an endpoint. The Endpoint element in a PortBinding can be used to specify a fixed port or left blank to choose a random port available to the cluster port range. The Endpoint element in the ServiceManifest enables Service Fabric to automatically publish the element to the Naming Service to enable discovery of the container. Following is an example:

<ServiceManifestImport> 
<ServiceManifestRef ServiceManifestName="FrontendServicePackage" ServiceManifestVersion="1.0"/>
<Policies>
<ContainerHostPolicies CodePackageRef="FrontendService.Code">
<PortBinding ContainerPort="8905" EndpointRef="Endpoint1"/>
</ContainerHostPolicies>
</Policies>
</ServiceManifestImport>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset