Creating a Connector with a Streaming Source
Create a connector in Connector Hub to transfer stream data from the Streaming service to a target service.
For more information about the Streaming service, see Streaming.
A connector that's defined with a Streaming source and (optional) function task supports the following targets: Functions, Logging Analytics, Object Storage, and Streaming. The Notifications target is supported only when no function task is used.
For an example of the Connector Hub workflow, see Overview of Connector Hub. For an example of a connector that uses Monitoring as the source, see Scenario: Sending Metrics to Object Storage.
- For stream input schema, see Message Reference.
- For a Notifications target with Streaming source, all messages are sent as raw JSON blobs.
Retention Period: Streaming Source
The retention period for the Streaming source in Connector Hub is customer-defined. See Limits on Streaming Resources. For more information about delivery, see Delivery Details.
Together with the retention period, the Streaming source's read position determines where in the stream to start moving data. You specify the read position when you specify the source connection.
Private Endpoint Prerequisites for Streams
Private endpoint configuration is supported for source and target streams. Following are prerequisites for accessing streams that use private endpoints.
- Ensure that you're granted permissions according to the following policies:
allow group <group-name> to manage virtual-network-family in compartment id <compartment-ocid> where any {request.operation='CreatePrivateEndpoint', request.operation='UpdatePrivateEndpoint', request.operation='DeletePrivateEndpoint', request.operation='ChangePrivateEndpointCompartment', request.operation='EnableReverseConnection', request.operation='ModifyReverseConnection', request.operation='DisableReverseConnection' }
allow group <group-name> to read stream-family in compartment id <compartment-ocid>
- To use a network security group (NSG), add the private endpoint to the NSG when creating the streaming pool.
After creating the connector, configure ingress and egress rules to let the connector access that private endpoint. See Private Endpoints: Configure Ingress and Egress Rules.
The creation process begins, and its progress is displayed. On completion, the connector's details page opens. Use the oci sch service-connector create command and required parameters to create a connector with a Streaming source:
oci sch service-connector create --display-name "<display_name>" --compartment-id <compartment_OCID> --source [<stream_source_in_JSON>] --target [<target_in_JSON>]
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the CreateServiceConnector operation to create a connector.
To create a connector with a Streaming source, populate
source
in the request (CreateServiceConnectorDetails) with streaming details. For an example, see StreamingSourceDetails.
Private Endpoints: Configure Ingress and Egress Rules
If you created a connector with a stream that uses a private endpoint, then configure ingress and egress rules to let the connector access that private endpoint.
- Get IP addresses for configuration:
- Get the IP addresses for the private endpoint (
rceTrafficIpAddress
andrceDnsIpAddress
) - Get the IP address for the private endpoint of the stream pool by viewing details of the stream pool on the Console. See Listing Streams and Stream Pools.
- Get the IP addresses for the private endpoint (
- Allow primary traffic: Add an ingress rule to the NSG or security list with the following configuration.
Console:
- Stateless: No
- Source:
rceTrafficIpAddress
(Example:10.0.0.249/32
) - IP Protocol: TCP
- Source Port Range: All
- Destination Port Range: All
API - example rule in request:
{ "protocol": "6", "source": "10.0.0.249/32" }
- Allow DNS lookups: Add an ingress rule to the NSG or security list with the following configuration.
Console:
- Stateless: No
- Source:
rceDnsIpAddress
(Example:10.0.0.240/32
) - IP Protocol: UDP
- Source Port Range: All
- Destination Port Range: All
API - example rule in request:
{ "protocol": "17", "source": "10.0.0.240/32" }
- Add an egress rule to the security list with the following configuration.
Console:
- Stateless: No
- Source:
streamPoolIpAddress
(Example:10.0.0.20/32
) - IP Protocol: TCP
- Source Port Range: All
- Destination Port Range: All
API - example rule in request:
{ "destination": "10.0.0.20/32", "protocol": "6" }
To change the source or target to use a different private stream, or to use a source or target other than Streaming, re-create the connector with the source and target that you want. An example of the need for a different private stream is a stream that was moved to a different stream pool. In that case, re-create the connector using the moved stream. Ensure that you deactivate or delete the old connector with the stream source or target that you don't want any more.
Confirm That the New Connector Moves Data
After you create the connector, confirm that it's moving data.
- Enable logs for the connector to get details on data flow.
- Check for expected results at the target service.
Confirming that data is moved helps you avoid automatic deactivation, which happens when a connector fails for a long time.
Private streams: To change the source or target to use a different private stream, or to use a source or target other than Streaming, re-create the connector with the source and target that you want. An example of the need for a different private stream is a stream that was moved to a different stream pool. In that case, re-create the connector using the moved stream. Ensure that you deactivate or delete the old connector with the stream source or target that you don't want any more.