SERVICENOW SOURCE AND SINK
The Kafka Connect ServiceNow Source Connector is used to move creations and updates in a ServiceNow Table to Apache Kafka® in real-time. Data is consumed from the ServiceNow table to Kafka topics in a timely manner using range queries against the ServiceNow Table API.
The ServiceNow Source Connector offers the following features:
retry.max.times
batch.max.rows
poll.interval.s
For a complete list of configuration properties for this connector, see ServiceNow Source Connector Configuration Properties.
Note
For an example of how to get Kafka Connect connected to Confluent Cloud, see Distributed Cluster.
The following are required to run the Kafka Connect ServiceNow Source Connector:
The quick start guide uses ServiceNow source connector to consume records from a ServiceNow Table and send them to Kafka. This guide assumes multi-tenant environment is used. For local testing, please refer to Running Connect in standalone mode.
Install the connector through the Confluent Hub Client.
# run from your confluent platform installation directory confluent-hub install confluentinc/kafka-connect-servicenow:latest
Start the Confluent Platform.
Tip
The command syntax for the Confluent CLI development commands changed in 5.3.0. These commands have been moved to confluent local. For example, the syntax for confluent start is now confluent local services start. For more information, see confluent local.
confluent local
confluent start
confluent local services start
Check the status of all services.
confluent local services status
Create a servicenow-source.json file with the following contents:
servicenow-source.json
// subsitute <> with your config { "name": "ServiceNowSourceConnector", "config": { "connector.class": "io.confluent.connect.servicenow.ServiceNowSourceConnector", "kafka.topic": "topic-servicenow", "servicenow.url": "https://<endpoint>.service-now.com/", "tasks.max": "1", "servicenow.table": "<table_name>", "servicenow.user": "<username>", "servicenow.password": "<password>", "servicenow.since": "2019-01-01", "key.converter": "org.apache.kafka.connect.json.JsonConverter", "value.converter": "org.apache.kafka.connect.json.JsonConverter", "confluent.topic.bootstrap.servers": "<server hostname>:9092", "confluent.license": "<license>", // leave it empty for evaluation license "poll.interval.s": "10", "confluent.topic.replication.factor": "1" } }
Load the ServiceNow Source Connector by posting configuration to Connect REST server.
Caution
You must include a double dash (--) between the topic name and your flag. For more information, see this post.
--
confluent local services connect connector load servicenow --config servicenow-source.json
Confirm that the connector is in a RUNNING state.
RUNNING
confluent local services connect connector status ServiceNowSourceConnector
Create one record to ServiceNow.
curl -X POST \ https://<endpoint>.service-now.com/api/now/table/<table_name> \ -H 'Accept: application/json' \ -H 'Authorization: Basic <token>' -H 'Content-Type: application/json' \ -H 'cache-control: no-cache' \ -d '{"short_description": "This is test"}'
Confirm the messages were delivered to the topic-servicenow topic in Kafka.
topic-servicenow
confluent local services kafka consume topic-servicenow --from-beginning