Skip to main content

PutAzureCosmosDBRecord

Description

This processor is a record-aware processor for inserting data into Cosmos DB with Core SQL API. It uses a configured record reader and schema to read an incoming record set from the body of a Flowfile and then inserts those records into a configured Cosmos DB Container.

Tags

azure, cosmos, insert, put, record

Properties

In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Cosmos DB Connection Serviceazure-cosmos-db-connection-serviceController Service:
AzureCosmosDBConnectionService

Implementations:
AzureCosmosDBClientService
If configured, the controller service used to obtain the connection string and access key
Cosmos DB URIazure-cosmos-db-uriCosmos DB URI, typically in the form of https://{databaseaccount}.documents.azure.com:443/ Note this host URL is for Cosmos DB with Core SQL API from Azure Portal (Overview->URI)
Cosmos DB Access Keyazure-cosmos-db-keyCosmos DB Access Key from Azure Portal (Settings->Keys). Choose a read-write key to enable database or container creation at run time
Cosmos DB Consistency Levelazure-cosmos-db-consistency-levelSESSION
  • STRONG
  • BOUNDED_STALENESS
  • SESSION
  • CONSISTENT_PREFIX
  • EVENTUAL
Choose from five consistency levels on the consistency spectrum. Refer to Cosmos DB documentation for their differences
Cosmos DB Name *azure-cosmos-db-nameThe database name or id. This is used as the namespace for document collections or containers
Cosmos DB Container ID *azure-cosmos-db-container-idThe unique identifier for the container
Cosmos DB Partition Key *azure-cosmos-db-partition-keyThe partition key used to distribute data among servers
Record Reader *record-readerController Service:
RecordReaderFactory

Implementations:
AvroReader
CEFReader
CSVReader
ExcelReader
GrokReader
JsonPathReader
JsonTreeReader
ReaderLookup
ScriptedReader
Syslog5424Reader
SyslogReader
WindowsEventLogReader
XMLReader
YamlTreeReader
Specifies the Controller Service to use for parsing incoming data and determining the data's schema
Insert Batch Sizeinsert-batch-size20The number of records to group together for one single insert operation against Cosmos DB
Cosmos DB Conflict Handling Strategyazure-cosmos-db-conflict-handling-strategyIgnore
  • Ignore
  • Upsert
Choose whether to ignore or upsert when conflict error occurs during insertion

Dynamic Properties

This component does not support dynamic properties.

Relationships

NameDescription
failureAll FlowFiles that cannot be written to Cosmos DB are routed to this relationship
successAll FlowFiles that are written to Cosmos DB are routed to this relationship

Reads Attributes

This processor does not read attributes.

Writes Attributes

This processor does not write attributes.

State Management

This component does not store state.

Restricted

This component is not restricted.

Input Requirement

This component requires an incoming relationship.

System Resource Considerations

ScopeDescription
MEMORYAn instance of this component can cause high usage of this system resource. Multiple instances or high concurrency settings may result a degradation of performance.

See Also