iotcs.config packageΒΆ

The config module defines a set of tunable parameters.

The tunable parameter control various behaviors of the library including messaging, network, etc..

# Copyright (c) 2018, 2019, Oracle and/or its affiliates.  All rights reserved.
#
# This software is dual-licensed to you under the MIT License (MIT) and
# the Universal Permissive License (UPL).  See the LICENSE file in the root
# directory for license terms.  You may choose either license, or both.

###############################################################################
[device_model]

# Set this property to a valid path to enable local storage of device models
device_model_store=

# When ${device_model_store} is a valid path device models will have a prefix
# of ${prefix} and suffix of ${suffix}
prefix=dm-
suffix=.json

# Default: false
# If true, a device can be activated without a device model on the server for
# the device. The server will create a
# draft device model which contains no attributes. A draft device model allows
# devices to be brought on-line ahead of the server being provisioned with the
# device model. However, attempts by the device to set an attribute when using a
# draft device model will fail.
allow_draft_device_models=False

##############################################################################
[rest_api]

# Set to True to use the IOT Cloud Service web REST api
use_webapi=False

##############################################################################
[device_messaging]

# Default: 4192 bytes
# The total size all of incoming messages received from the server that have
# not been handled by callbacks to the
# application.
request_buffer_size=4192

# Default: false
# Long polling is used by default, set this to true to disable it.
disable_long_polling=False

# Default: 1
# Number of threads created for dispatching request messages so that
# request handlers can be executed in parallel.
# This number should be specified as greater than one, else it will be ignored
# and the default value of one will be used for request handler thread pool
# size. Request Dispatcher should be used for request handling for this setting
# to be effective.
request_dispatcher_thread_pool_size=1

# Default: 10000
# Total messages to queue. Attempts to send messages when the queue is full
# will result in an error.
dispatcher_max_queue_size=10000

# Default: 100
# Maximum number of outgoing messages to send in one payload per HTTPS
# connection to the server.
dispatcher_max_messages_per_connection=100

# Default: 3 seconds
# The polling interval, in seconds, for message dispatching. If a message is
# not sent to the server within this timeout, an empty message will be sent in
# order to solicit request messages that may be queued in the server.
dispatcher_polling_interval=3000

# Default: 100 milliseconds
# The time, in milliseconds, added to the receive timeout given by the
# application and then used for the client transport timeout.
long_polling_timeout_offset=100

# Default: 100 milliseconds
# Only used when long polling is disabled. The minimum time, in milliseconds,
# since the last send before polling the server for incoming messages if the
# receive buffer is empty. A larger value may cause a delay in the receipt of
# incoming messages, but will cause less network overhead. A value of zero
# will cause the library to skip the poll for incoming messages when calling
# receive if the receive buffer is empty.
send_receive_timeout=100

# Default: 15000 milliseconds
# Only used when long polling is disabled. The amount of time, in milliseconds,
# to wait for the server to respond
# to an HTTPS request.
http_response_timeout=15000

# The number of retry attempts made by the MessageDispatcher
dispatcher_basic_number_of_retries = 3

# The amount of time to wait before dispatching requests that were dispatched
# when initially received, milliseconds
dispatcher_settle_time = 10000

# The maximum number of times to try and obtain an access token
access_token_max_retries = 3

# The number of seconds to wait for a message to become available in the
# message queue or for space to become available if the maximum size,
# dispatcher_max_queue_size, is reached
message_queue_waittime = 10

# Amount of time in milliseconds to backoff in the face of a 503 from the
# server. This is the starting value for the amount of time to backoff.
# The backoff time increases exponentially if the server continues to return
# a 503. Defaults to 1000 milliseconds. Not less than 100 milliseconds.
message_dispatcher_backoff=1000

# The default Message.Reliability for DataMessages.
# One of "GUARANTEED_DELIVERY", "BEST_EFFORT", "NO_GUARANTEE"
data_message_reliability=BEST_EFFORT

# The default Message.Reliability for AlertMessages
# One of "GUARANTEED_DELIVERY", "BEST_EFFORT", "NO_GUARANTEE"
alert_message_reliability=GUARANTEED_DELIVERY

#############################################################################
[diagnostics]

# The client library version
client_version=18.3.5

# The library assumes that if client_ip_address is set,
# client_mac_addrese is also set

# The fixed client IP address
#client_ip_address=192.168.1.10

# The client MAC address
#client_mac_address=XX:XX:XX:XX

# A colon separated string of paths <path0>:<path1> or a single path used
# by diagnostics to collect total and free disk usage
client_paths=.

#############################################################################
[enterprise_messaging]

# Default: 3000 milliseconds
# The amount of delay, in milliseconds, between polls for messages by the
# MessagePoller. This setting affects how
# often a MessageEnumerator.MessageListener instance may be called.
message_polling_interval=3000

# Default: 10
# The maximum number of messages to return on a single poll by the
# MessagePoller. The value will be clamped
# between 10 and 200, inclusive.
message_polling_limit=10

# Default: 10 messages
# The number of messages in each page the message enumerator retrives from the
# server.
message_refill_count=10


##############################################################################
[logging]

# Default: true
# Controls whether or not logged messages should be pretty printed. Pretty
# printing the messages makes the JSON easier to read. By default, pretty
# printing is enabled. Set this property to false to disable pretty printing
# for a more compact view of the logged messages.
pretty_print_messages=False


###############################################################################
[http]

# Default: -1 seconds (default to the servers timeout)
# The maximum time in seconds iotcs.http.SecureConnection will wait for the
# the server to respond to a request. If the library is "long polling"
# "[device_messaging]["disable_long_polling"] == False", the request will wait
# for the server to respond, typically 10 minutes.
# If set to -1 SecureConnection will defer to the server. If greater than zero
# the SecureConnection will use the value set here.
http_connection_timeout=-1

# Default: -1 (default to the servers timeout)
# The maximum time in seconds (a float) iotcs.http.SecureConnection will wait
# for the the server to respond to a request. If the library is "long polling"
# ''["device_messaging"]["disable_long_polling"] == False', the request will
# wait for the server to respond, typically 10 minutes.
# If not set or 0.0 SecureConnection will defer to the server. If greater than
# zero the SecureConnection will use the value set here.
http_read_timeout=-1

# Default: None
# The proxy to use for requests. The form of the url is
# <scheme>://<host>:<port>/ eg. https://proxyserver.com:9090/
# Note: The url MUST have a trailing slash
#proxy=

# Default: None
# The user ID and password, separated by a colon, for basic proxy authentication.
# proxy_auth=userid:password
###############################################################################
[media_storage]

# Default: false
# Disable the prefixing the storage object's name with the device's client ID
# and a directory separator.
disable_storage_object_prefix=False
storage_connection_host_name=storage.oraclecloud.com
storage_connection_retry_limit=2

# Default: None
# The proxy to use for all media storage requests. The form of the url is
# <scheme>://<host>:<port>/ eg. https://proxyserver.com:9090/
# Note: The url MUST have a trailing slash
#proxy=

###############################################################################
[device_policy]

# Default: ETHERNET
# Used by the "batchByCost" device function, set this property to the type of
# connected network. The property may be set from the application code; for
# example, when the type of connected network changes.
network_cost=ETHERNET


###############################################################################
[message_persistence]

# Default: persistence store database name for messages
# The name the database used for persisting messages.
# If a relative path (no leading "/") the library uses the user's HOME
# directory.
db_name=iotcs/msps.db

# Default: true
# If True, the client library will persist data.
enabled=True

###############################################################################
[batchby_persistence]

# Default: persistence store database name for policy batch persistence
# The name the database used for persisting "batchBy" policy data.
# If a relative path (no leading "/") the library uses the user's HOME
# directory
db_name=iotcs/bbps.db

# Default: true
# If True, the client library will persist data.
enabled=True