blob: 3f1157866a52c629b8a0a97a085d854204d10d4e [file] [log] [blame]
<!DOCTYPE html>
<html lang="1.2" class="js csstransforms3d">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Hugo 0.81.0" />
<meta name="description" content="A set of micro-services for connecting millions of devices.">
<meta name="author" content="The Eclipse Hono Project">
<link rel="apple-touch-icon" sizes="180x180" href="/hono/docs/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="48x48" href="/hono/docs/favicon/favicon-48x48.png">
<link rel="icon" type="image/png" sizes="32x32" href="/hono/docs/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/hono/docs/favicon/favicon-16x16.png">
<link rel="manifest" href="/hono/docs/favicon/site.webmanifest">
<link rel="mask-icon" href="/hono/docs/favicon/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/hono/docs/favicon/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="/hono/docs/favicon/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<title>Hono Client Configuration :: Eclipse Hono&trade; Vers.: 1.2</title>
<link href="/hono/docs/css/nucleus.css?1626138730" rel="stylesheet">
<link href="/hono/docs/css/fontawesome-all.min.css?1626138730" rel="stylesheet">
<link href="/hono/docs/css/hybrid.css?1626138730" rel="stylesheet">
<link href="/hono/docs/css/featherlight.min.css?1626138730" rel="stylesheet">
<link href="/hono/docs/css/perfect-scrollbar.min.css?1626138730" rel="stylesheet">
<link href="/hono/docs/css/auto-complete.css?1626138730" rel="stylesheet">
<link href="/hono/docs/css/atom-one-dark-reasonable.css?1626138730" rel="stylesheet">
<link href="/hono/docs/css/theme.css?1626138730" rel="stylesheet">
<link href="/hono/docs/css/hugo-theme.css?1626138730" rel="stylesheet">
<link href="/hono/docs/css/theme-hono.css?1626138730" rel="stylesheet">
<link href="/hono/docs/css/hono.css?1626138730" rel="stylesheet">
<script src="/hono/docs/js/jquery-3.3.1.min.js?1626138730"></script>
<style>
:root #header + #content > #left > #rlblock_left{
display:none !important;
}
:not(pre) > code + span.copy-to-clipboard {
display: none;
}
</style>
<link rel="stylesheet" href="https://www.eclipse.org/eclipse.org-common/themes/solstice/public/stylesheets/vendor/cookieconsent/cookieconsent.min.css">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@EclipseHono">
<meta name="twitter:title" content="Hono Client Configuration :: Eclipse Hono&amp;trade; Vers.: 1.2">
<meta name="twitter:image" content="https://www.eclipse.org/hono/docs/images/twitter_image.png">
<meta name="twitter:description" content="A set of micro-services for connecting millions of devices.">
<meta property="og:title" content="Hono Client Configuration :: Eclipse Hono&amp;trade; Vers.: 1.2" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://www.eclipse.org/hono/docs/1.2/admin-guide/hono-client-configuration//" />
<meta property="og:image" content="https://www.eclipse.org/hono/docs/images/twitter_image.png" />
</head>
<body class="" data-url="/hono/docs/1.2/admin-guide/hono-client-configuration/">
<nav id="sidebar" class="">
<div id="header-wrapper">
<div id="header">
<a href="https://www.eclipse.org/hono/">
<img src="/hono/docs/images/HONO-Logo_Bild-Wort_quer-w-310x120px.svg" alt="Hono logo" class="logo-img">
</a>
</div>
<div class="searchbox">
<label for="search-by"><i class="fas fa-search"></i></label>
<input data-search-input id="search-by" type="search" placeholder="Search...">
<span data-search-clear=""><i class="fas fa-times"></i></span>
</div>
<script type="text/javascript" src="/hono/docs/js/lunr.min.js?1626138730"></script>
<script type="text/javascript" src="/hono/docs/js/auto-complete.js?1626138730"></script>
<script type="text/javascript">
var baseurl = "https:\/\/www.eclipse.org\/hono\/docs\/\/1.2";
</script>
<script type="text/javascript" src="/hono/docs/js/search.js?1626138730"></script>
</div>
<div class="highlightable">
<ul class="topics">
<li data-nav-id="/hono/docs/1.2/concepts/" title="Concepts" class="dd-item
">
<a href="/hono/docs/1.2/concepts/">
<i class="far fa-lightbulb"></i> Concepts
</a>
<ul>
<li data-nav-id="/hono/docs/1.2/concepts/device-identity/" title="Device Identity" class="dd-item ">
<a href="/hono/docs/1.2/concepts/device-identity/">
Device Identity
</a>
</li>
<li data-nav-id="/hono/docs/1.2/concepts/tenancy/" title="Multi-Tenancy" class="dd-item ">
<a href="/hono/docs/1.2/concepts/tenancy/">
Multi-Tenancy
</a>
</li>
<li data-nav-id="/hono/docs/1.2/concepts/device-provisioning/" title="Device Provisioning" class="dd-item ">
<a href="/hono/docs/1.2/concepts/device-provisioning/">
Device Provisioning
</a>
</li>
<li data-nav-id="/hono/docs/1.2/concepts/connecting-devices/" title="Connecting Devices" class="dd-item ">
<a href="/hono/docs/1.2/concepts/connecting-devices/">
Connecting Devices
</a>
</li>
<li data-nav-id="/hono/docs/1.2/concepts/device-notifications/" title="Device Notifications" class="dd-item ">
<a href="/hono/docs/1.2/concepts/device-notifications/">
Device Notifications
</a>
</li>
<li data-nav-id="/hono/docs/1.2/concepts/command-and-control/" title="Command &amp; Control" class="dd-item ">
<a href="/hono/docs/1.2/concepts/command-and-control/">
Command &amp; Control
</a>
</li>
<li data-nav-id="/hono/docs/1.2/concepts/resource-limits/" title="Resource limits" class="dd-item ">
<a href="/hono/docs/1.2/concepts/resource-limits/">
Resource limits
</a>
</li>
<li data-nav-id="/hono/docs/1.2/concepts/connection-events/" title="Connection Events" class="dd-item ">
<a href="/hono/docs/1.2/concepts/connection-events/">
Connection Events
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/1.2/user-guide/" title="User Guide" class="dd-item
">
<a href="/hono/docs/1.2/user-guide/">
<i class="fas fa-book-reader"></i> User Guide
</a>
<ul>
<li data-nav-id="/hono/docs/1.2/user-guide/device-registry/" title="Device Registry" class="dd-item ">
<a href="/hono/docs/1.2/user-guide/device-registry/">
Device Registry
</a>
</li>
<li data-nav-id="/hono/docs/1.2/user-guide/http-adapter/" title="HTTP Adapter" class="dd-item ">
<a href="/hono/docs/1.2/user-guide/http-adapter/">
HTTP Adapter
</a>
</li>
<li data-nav-id="/hono/docs/1.2/user-guide/mqtt-adapter/" title="MQTT Adapter" class="dd-item ">
<a href="/hono/docs/1.2/user-guide/mqtt-adapter/">
MQTT Adapter
</a>
</li>
<li data-nav-id="/hono/docs/1.2/user-guide/amqp-adapter/" title="AMQP Adapter" class="dd-item ">
<a href="/hono/docs/1.2/user-guide/amqp-adapter/">
AMQP Adapter
</a>
</li>
<li data-nav-id="/hono/docs/1.2/user-guide/coap-adapter/" title="CoAP Adapter" class="dd-item ">
<a href="/hono/docs/1.2/user-guide/coap-adapter/">
CoAP Adapter
</a>
</li>
<li data-nav-id="/hono/docs/1.2/user-guide/kura-adapter/" title="Kura Adapter" class="dd-item ">
<a href="/hono/docs/1.2/user-guide/kura-adapter/">
Kura Adapter
</a>
</li>
<li data-nav-id="/hono/docs/1.2/user-guide/sigfox-adapter/" title="Sigfox Adapter" class="dd-item ">
<a href="/hono/docs/1.2/user-guide/sigfox-adapter/">
Sigfox Adapter
</a>
</li>
<li data-nav-id="/hono/docs/1.2/user-guide/jmeter_load_tests/" title="Load Tests with JMeter" class="dd-item ">
<a href="/hono/docs/1.2/user-guide/jmeter_load_tests/">
Load Tests with JMeter
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/1.2/admin-guide/" title="Admin Guide" class="dd-item
parent
">
<a href="/hono/docs/1.2/admin-guide/">
<i class="fas fa-sliders-h"></i> Admin Guide
</a>
<ul>
<li data-nav-id="/hono/docs/1.2/admin-guide/common-config/" title="Common Configuration" class="dd-item ">
<a href="/hono/docs/1.2/admin-guide/common-config/">
Common Configuration
</a>
</li>
<li data-nav-id="/hono/docs/1.2/admin-guide/auth-server-config/" title="Auth Server Configuration" class="dd-item ">
<a href="/hono/docs/1.2/admin-guide/auth-server-config/">
Auth Server Configuration
</a>
</li>
<li data-nav-id="/hono/docs/1.2/admin-guide/device-registry-config/" title="Device Registry Configuration" class="dd-item ">
<a href="/hono/docs/1.2/admin-guide/device-registry-config/">
Device Registry Configuration
</a>
</li>
<li data-nav-id="/hono/docs/1.2/admin-guide/device-connection-config/" title="Configuring the Device Connection Service" class="dd-item ">
<a href="/hono/docs/1.2/admin-guide/device-connection-config/">
Device Connection Service Configuration
</a>
</li>
<li data-nav-id="/hono/docs/1.2/admin-guide/http-adapter-config/" title="HTTP Adapter Configuration" class="dd-item ">
<a href="/hono/docs/1.2/admin-guide/http-adapter-config/">
HTTP Adapter Configuration
</a>
</li>
<li data-nav-id="/hono/docs/1.2/admin-guide/amqp-adapter-config/" title="AMQP Adapter Configuration" class="dd-item ">
<a href="/hono/docs/1.2/admin-guide/amqp-adapter-config/">
AMQP Adapter Configuration
</a>
</li>
<li data-nav-id="/hono/docs/1.2/admin-guide/mqtt-adapter-config/" title="MQTT Adapter Configuration" class="dd-item ">
<a href="/hono/docs/1.2/admin-guide/mqtt-adapter-config/">
MQTT Adapter Configuration
</a>
</li>
<li data-nav-id="/hono/docs/1.2/admin-guide/kura-adapter-config/" title="Kura Adapter Configuration" class="dd-item ">
<a href="/hono/docs/1.2/admin-guide/kura-adapter-config/">
Kura Adapter Configuration
</a>
</li>
<li data-nav-id="/hono/docs/1.2/admin-guide/hono-client-configuration/" title="Hono Client Configuration" class="dd-item active">
<a href="/hono/docs/1.2/admin-guide/hono-client-configuration/">
Hono Client Configuration
</a>
</li>
<li data-nav-id="/hono/docs/1.2/admin-guide/amqp-network-config/" title="AMQP 1.0 Messaging Network Configuration" class="dd-item ">
<a href="/hono/docs/1.2/admin-guide/amqp-network-config/">
AMQP 1.0 Messaging Network Configuration
</a>
</li>
<li data-nav-id="/hono/docs/1.2/admin-guide/secure_communication/" title="Secure Communication" class="dd-item ">
<a href="/hono/docs/1.2/admin-guide/secure_communication/">
Secure Communication
</a>
</li>
<li data-nav-id="/hono/docs/1.2/admin-guide/monitoring-tracing-config/" title="Monitoring &amp; Tracing" class="dd-item ">
<a href="/hono/docs/1.2/admin-guide/monitoring-tracing-config/">
Monitoring &amp; Tracing
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/1.2/dev-guide/" title="Developer Guide" class="dd-item
">
<a href="/hono/docs/1.2/dev-guide/">
<i class="fas fa-tools"></i> Developer Guide
</a>
<ul>
<li data-nav-id="/hono/docs/1.2/dev-guide/building_hono/" title="Building from Source" class="dd-item ">
<a href="/hono/docs/1.2/dev-guide/building_hono/">
Building from Source
</a>
</li>
<li data-nav-id="/hono/docs/1.2/dev-guide/amqp_adapter_client/" title="AMQP Adapter Client for Java" class="dd-item ">
<a href="/hono/docs/1.2/dev-guide/amqp_adapter_client/">
AMQP Adapter Client for Java
</a>
</li>
<li data-nav-id="/hono/docs/1.2/dev-guide/java_client_consumer/" title="Consuming Messages from Java" class="dd-item ">
<a href="/hono/docs/1.2/dev-guide/java_client_consumer/">
Consuming Messages from Java
</a>
</li>
<li data-nav-id="/hono/docs/1.2/dev-guide/custom_http_adapter/" title="Implement a Custom Hono HTTP Protocol Adapter" class="dd-item ">
<a href="/hono/docs/1.2/dev-guide/custom_http_adapter/">
Implement a Custom Hono HTTP Protocol Adapter
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/1.2/api/" title="API" class="dd-item
">
<a href="/hono/docs/1.2/api/">
&nbsp;<i class='fas fa-plug'></i>&nbsp;API
</a>
<ul>
<li data-nav-id="/hono/docs/1.2/api/telemetry/" title="Telemetry API Specification" class="dd-item ">
<a href="/hono/docs/1.2/api/telemetry/">
Telemetry API
</a>
</li>
<li data-nav-id="/hono/docs/1.2/api/event/" title="Event API Specification" class="dd-item ">
<a href="/hono/docs/1.2/api/event/">
Event API
</a>
</li>
<li data-nav-id="/hono/docs/1.2/api/command-and-control/" title="Command &amp; Control API Specification" class="dd-item ">
<a href="/hono/docs/1.2/api/command-and-control/">
Command &amp; Control API
</a>
</li>
<li data-nav-id="/hono/docs/1.2/api/tenant/" title="Tenant API Specification" class="dd-item ">
<a href="/hono/docs/1.2/api/tenant/">
Tenant API
</a>
</li>
<li data-nav-id="/hono/docs/1.2/api/device-connection/" title="Device Connection API Specification" class="dd-item ">
<a href="/hono/docs/1.2/api/device-connection/">
Device Connection API
</a>
</li>
<li data-nav-id="/hono/docs/1.2/api/device-registration/" title="Device Registration API Specification" class="dd-item ">
<a href="/hono/docs/1.2/api/device-registration/">
Device Registration API
</a>
</li>
<li data-nav-id="/hono/docs/1.2/api/credentials/" title="Credentials API Specification" class="dd-item ">
<a href="/hono/docs/1.2/api/credentials/">
Credentials API
</a>
</li>
<li data-nav-id="/hono/docs/1.2/api/authentication/" title="Authentication API Specification" class="dd-item ">
<a href="/hono/docs/1.2/api/authentication/">
Authentication API
</a>
</li>
<li data-nav-id="/hono/docs/1.2/api/management/" title="Device Registry Management API Specification" class="dd-item ">
<a href="/hono/docs/1.2/api/management/">
Device Registry Management API
</a>
</li>
<li data-nav-id="/hono/docs/1.2/api/metrics/" title="Metrics" class="dd-item ">
<a href="/hono/docs/1.2/api/metrics/">
Metrics
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/1.2/deployment/" title="Deployment" class="dd-item
">
<a href="/hono/docs/1.2/deployment/">
<i class="fas fa-shipping-fast"></i> Deployment
</a>
<ul>
<li data-nav-id="/hono/docs/1.2/deployment/helm-based-deployment/" title="Helm based Deployment" class="dd-item ">
<a href="/hono/docs/1.2/deployment/helm-based-deployment/">
Helm based Deployment
</a>
</li>
<li data-nav-id="/hono/docs/1.2/deployment/openshift/" title="OpenShift / OKD" class="dd-item ">
<a href="/hono/docs/1.2/deployment/openshift/">
OpenShift / OKD
</a>
</li>
<li data-nav-id="/hono/docs/1.2/deployment/create-kubernetes-cluster/" title="Setting up a Kubernetes Cluster" class="dd-item ">
<a href="/hono/docs/1.2/deployment/create-kubernetes-cluster/">
Setting up a Kubernetes Cluster
</a>
</li>
<li data-nav-id="/hono/docs/1.2/deployment/resource-limitation/" title="Limiting Resource Usage" class="dd-item ">
<a href="/hono/docs/1.2/deployment/resource-limitation/">
Limiting Resource Usage
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/1.2/architecture/" title="Architecture" class="dd-item
">
<a href="/hono/docs/1.2/architecture/">
<i class="fas fa-landmark"></i> Architecture
</a>
<ul>
<li data-nav-id="/hono/docs/1.2/architecture/component-view/" title="Component View" class="dd-item ">
<a href="/hono/docs/1.2/architecture/component-view/">
Component View
</a>
</li>
<li data-nav-id="/hono/docs/1.2/architecture/auth/" title="Authentication/Authorization" class="dd-item ">
<a href="/hono/docs/1.2/architecture/auth/">
Authentication/Authorization
</a>
</li>
</ul>
</li>
</ul>
<section id="shortcuts">
<h3></h3>
<ul>
<li>
<a class="padding" href="https://www.eclipse.org/hono/" title="Hono&#39;s Homepage"><i class='fas fa-home'></i> Hono Home</a>
</li>
<li>
<a class="padding" href="https://www.eclipse.org/hono/getting-started/" title="Getting started with Eclipse Hono"><i class='fas fa-plane-departure'></i> Getting Started</a>
</li>
</ul>
</section>
<section id="prefooter">
<hr/>
<ul>
<li>
<div id="select-box-wrapper">
<div id="select-box">
<a class="padding">
Version:&nbsp;
<div class="select-style">
<select id="select-language" onchange="location = this.value;">
<option id="stable" value="https://www.eclipse.org/hono/docs/admin-guide/hono-client-configuration/">stable (1.8)</option>
<option id="1.8" value="https://www.eclipse.org/hono/docs/1.8/admin-guide/hono-client-configuration/">1.8</option>
<option id="1.7" value="https://www.eclipse.org/hono/docs/1.7/admin-guide/hono-client-configuration/">1.7</option>
<option id="1.6" value="https://www.eclipse.org/hono/docs/1.6/admin-guide/hono-client-configuration/">1.6</option>
<option id="1.5" value="https://www.eclipse.org/hono/docs/1.5/admin-guide/hono-client-configuration/">1.5</option>
<option id="1.4" value="https://www.eclipse.org/hono/docs/1.4/admin-guide/hono-client-configuration/">1.4</option>
<option id="1.3" value="https://www.eclipse.org/hono/docs/1.3/admin-guide/hono-client-configuration/">1.3</option>
<option id="1.2" value="https://www.eclipse.org/hono/docs/1.2/admin-guide/hono-client-configuration/" selected>1.2</option>
<option id="1.1" value="https://www.eclipse.org/hono/docs/1.1/admin-guide/hono-client-configuration/">1.1</option>
<option id="1.0" value="https://www.eclipse.org/hono/docs/1.0/admin-guide/hono-client-configuration/">1.0</option>
<option id="dev" value="https://www.eclipse.org/hono/docs/dev/admin-guide/hono-client-configuration/">dev</option>
</select>
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="255px" height="255px" viewBox="0 0 255 255" style="enable-background:new 0 0 255 255;" xml:space="preserve">
<g>
<g id="arrow-drop-down">
<polygon points="0,63.75 127.5,191.25 255,63.75 " />
</g>
</g>
</svg>
</div>
</a>
</div>
</div>
</li>
</ul>
</section>
<section id="footer">
<p>&copy; 2021 <a href="https://www.eclipse.org/hono/">The Eclipse Hono Project</a></p>
<p>
Documentation built with
<a href="https://gohugo.io/" target="_blank">Hugo</a>
using the
<a href="https://github.com/matcornic/hugo-theme-learn" target="_blank">Learn</a> theme.
</p>
<div class="eclipse-logo">
<a href="https://www.eclipse.org" target="_blank">
<img src="https://www.eclipse.org/hono/docs/images/eclipse_foundation_logo.svg"/>
</a>
</div>
</section>
</div>
</nav>
<section id="body">
<div id="overlay"></div>
<div class="old-version-hint">
<p>This page refers to version <em>1.2</em>.
You might want to use the <a href="https://www.eclipse.org/hono/docs/">current stable</a> version.
</p>
</div>
<div class="padding highlightable">
<div>
<div id="top-bar">
<div id="top-github-link">
<a class="github-link" title='Edit this page' href="https://github.com/eclipse/hono/edit/master/site/documentation/content/admin-guide/hono-client-configuration.md" target="blank">
<i class="fas fa-code-branch"></i>
<span id="top-github-link-text">Edit this page</span>
</a>
</div>
<div id="breadcrumbs" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
<span id="sidebar-toggle-span">
<a href="#" id="sidebar-toggle" data-sidebar-toggle="">
<i class="fas fa-bars"></i>
</a>
</span>
<span id="toc-menu"><i class="fas fa-list-alt"></i></span>
<span class="links">
<a href='/hono/docs/1.2/'>Documentation</a> > <a href='/hono/docs/1.2/admin-guide/'>Admin Guide</a> > Hono Client Configuration
</span>
</div>
<div class="progress">
<div class="wrapper">
<nav id="TableOfContents">
<ul>
<li><a href="#connection-properties">Connection Properties</a></li>
<li><a href="#response-caching">Response Caching</a></li>
<li><a href="#using-tls">Using TLS</a></li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<div id="head-tags">
</div>
<div id="body-inner">
<h1>
Hono Client Configuration
</h1>
<p>The <code>org.eclipse.hono.client.HonoConnection</code> factory can be used to create AMQP 1.0 connections to Hono&rsquo;s service components.</p>
<p>The factory uses environment variables and/or command line options to configure the connection to the service and the caching of
responses to service invocations. All variables used for configuring the connection factory for a particular service share a
common <em>prefix</em>. This way, multiple sets of variables can be used to configure multiple factories for connecting to different
service endpoints without interfering with each other. For example, the set of variables for configuring the connection factory
for the Device Registration service may use the common prefix <code>HONO_REGISTRATION</code> whereas the set for configuring the factory
for the Credentials service may use <code>HONO_CREDENTIALS</code>.</p>
<h2 id="connection-properties">Connection Properties</h2>
<p>The following table provides an overview of the configuration variables and corresponding command line options for configuring
the AMQP connection to the service.
Note that the variables map to the properties of classes <code>org.eclipse.hono.config.ClientConfigProperties</code>
and <code>org.eclipse.client.RequestResponseClientConfigProperties</code> which can be used to programmatically configure a client.</p>
<p>The variable names contain <code>${PREFIX}</code> as a placeholder for the particular <em>common prefix</em> being used. The <code>${prefix}</code> placeholder
used in the command line option name is the same as <code>${PREFIX}</code>, using all lower case characters and <code>.</code> instead of <code>_</code> as the
delimiter, e.g. the variable prefix <code>HONO_CREDENTIALS</code> corresponds to the command line option prefix <code>hono.credentials</code>).</p>
<table>
<thead>
<tr>
<th style="text-align:left">Environment Variable<br>Command Line Option</th>
<th style="text-align:center">Mandatory</th>
<th style="text-align:left">Default Value</th>
<th style="text-align:left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>${PREFIX}_AMQPHOSTNAME</code><br><code>--${prefix}.amqpHostname</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left">-</td>
<td style="text-align:left">The name to use as the <em>hostname</em> in the client&rsquo;s AMQP <em>open</em> frame during connection establishment. This variable can be used to indicate the <em>virtual host</em> to connect to on the server.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_CERTPATH</code><br><code>--${prefix}.certPath</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left">-</td>
<td style="text-align:left">The absolute path to the PEM file containing the certificate that the client should use for authenticating to the server. This variable must be used in conjunction with <code>${PREFIX}_KEY_PATH</code>.<br>Alternatively, the <code>${PREFIX}_KEYSTOREPATH</code> variable can be used to configure a key store containing both the key as well as the certificate.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_CONNECTTIMEOUT</code><br><code>--${prefix}.connectTimeout</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>5000</code></td>
<td style="text-align:left">The maximum amount of time (milliseconds) that the client should wait for the AMQP connection to be opened. This includes the time for TCP/TLS connection establishment, SASL handshake and exchange of the AMQP <em>open</em> frame. This property can be used to tune the time period to wait according to the network latency involved with the connection between the client and the service.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_CREDENTIALSPATH</code><br><code>--${prefix}.credentialsPath</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left">-</td>
<td style="text-align:left">The absolute path to a properties file that contains a <em>username</em> and a <em>password</em> property to use for authenticating to the service.<br>This variable is an alternative to using <code>${PREFIX}_USERNAME</code> and <code>${PREFIX}_PASSWORD</code> which has the advantage of not needing to expose the secret (password) in the client process' environment.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_FLOWLATENCY</code><br><code>--${prefix}.flowLatency</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>20</code></td>
<td style="text-align:left">The maximum amount of time (milliseconds) that the client should wait for <em>credits</em> after a link to the service has been established.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_HOST</code><br><code>--${prefix}.host</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>localhost</code></td>
<td style="text-align:left">The IP address or name of the host to connect to. <strong>NB</strong> This needs to be set to an address that can be resolved within the network the adapter runs on. When running as a Docker container, use Docker&rsquo;s <code>--network</code> command line option to attach the local container to the Docker network that the service is running on.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_HOSTNAMEVERIFICATIONREQUIRED</code><br><code>--${prefix}.hostnameVerificationRequired</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>true</code></td>
<td style="text-align:left">A flag indicating whether the value of the <code>${PREFIX}_HOST</code> variable must match the <em>distinguished name</em> or any of the <em>alternative names</em> asserted by the server&rsquo;s certificate when connecting using TLS.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_IDLETIMEOUT</code><br><code>--${prefix}.idleTimeout</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>16000</code></td>
<td style="text-align:left">Sets the amount of time in milliseconds after which a connection will be closed when no frames have been received from the remote peer. This property is also used to configure a heartbeat mechanism, checking that the connection is still alive. The corresponding heartbeat interval will be set to <em>idleTimeout/2</em> ms.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_INITIALCREDITS</code><br><code>--${prefix}.initialCredits</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>200</code></td>
<td style="text-align:left">The number of <em>credits</em> that a consuming client will initially issue to the service (sender) after link creation. This value effectively limits the number of messages that can be <em>in flight</em> unsettled.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_KEYPATH</code><br><code>--${prefix}.keyPath</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left">-</td>
<td style="text-align:left">The absolute path to the (PKCS8) PEM file containing the private key that the client should use for authenticating to the server. Note that the private key is not protected by a password. You should therefore make sure that the key file can only be read by the user that the client process is running under. This variable must be used in conjunction with <code>${PREFIX}_CERTPATH</code>. Alternatively, the <code>${PREFIX}_KEYSTOREPATH</code> variable can be used to configure a key store containing both the key as well as the certificate.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_KEYSTOREPASSWORD</code><br><code>--${prefix}.keyStorePassword</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left">-</td>
<td style="text-align:left">The password required to read the contents of the key store.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_KEYSTOREPATH</code><br><code>--${prefix}.keyStorePath</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left">-</td>
<td style="text-align:left">The absolute path to the Java key store containing the private key and certificate that the client should use for authenticating to the server. Either this variable or the <code>${PREFIX}_KEYPATH</code> and <code>${PREFIX}_CERTPATH</code> variables need to be set in order to enable <em>SASL External</em> based authentication to the server. The key store format can be either <code>JKS</code> or <code>PKCS12</code> indicated by a <code>.jks</code> or <code>.p12</code> file suffix respectively.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_LINKESTABLISMENTTIMEOUT</code><br><code>--${prefix}.linkEstablishmentTimeout</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>1000</code></td>
<td style="text-align:left">The maximum amount of time (milliseconds) that the client should wait for the service&rsquo;s <em>attach</em> frame during link establishment. This property can be used to tune the time period to wait according to the network latency involved with the communication link between the client and the service.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_NAME</code><br><code>--${prefix}.name</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left">-</td>
<td style="text-align:left">The name to use as the <em>container-id</em> in the client&rsquo;s AMQP <em>open</em> frame during connection establishment.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_PASSWORD</code><br><code>--${prefix}.password</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left">-</td>
<td style="text-align:left">The password to use for authenticating to the service.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_PORT</code><br><code>--${prefix}.port</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>5671</code></td>
<td style="text-align:left">The port that the service is listening on.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_SENDMESSAGETIMEOUT</code><br><code>--${prefix}.sendMessageTimeout</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>1000</code></td>
<td style="text-align:left">The maximum number of milliseconds to wait for a delivery update after an event or command message was sent before the send operation is failed. Setting this value to a higher value increases the chance of successful service invocation in situations where network latency is high.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_RECONNECTATTEMPTS</code><br><code>--${prefix}.reconnectAttempts</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>-1</code></td>
<td style="text-align:left">The number of attempts (in addition to the original connection attempt) that the client should make in order to establish an AMQP connection with the peer before giving up. The default value of this property is -1 which means that the client will try forever.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_RECONNECTDELAYINCREMENT</code><br><code>--${prefix}.reconnectDelayIncrement</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>100</code></td>
<td style="text-align:left">The factor (milliseconds) used in the exponential backoff algorithm for determining the delay before trying to re-establish an AMQP connection with the peer. The delay after an initial, failed connection attempt will be the value of the <code>${PREFIX}_RECONNECTMINDELAY</code> variable. Each subsequent connection attempt will use a random delay between the minimum delay and the value determined by exponentially increasing the delay by the <code>${PREFIX}_RECONNECTDELAYINCREMENT</code> factor. The overall limit of the delay time is defined by the <code>${PREFIX}_RECONNECTMAXDELAY</code> variable.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_RECONNECTMAXDELAY</code><br><code>--${prefix}.reconnectMaxDelay</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>7000</code></td>
<td style="text-align:left">The maximum number of milliseconds to wait before trying to re-establish an AMQP connection with the peer.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_RECONNECTMINDELAY</code><br><code>--${prefix}.reconnectMinDelay</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>0</code></td>
<td style="text-align:left">The minimum number of milliseconds to wait before trying to re-establish an AMQP connection with the peer.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_REQUESTTIMEOUT</code><br><code>--${prefix}.requestTimeout</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>200</code></td>
<td style="text-align:left">The maximum number of milliseconds to wait for a response before a service invocation is failed. Setting this value to a higher value increases the chance of successful service invocation in situations where network latency is high.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_SECUREPROTOCOLS</code><br><code>--${prefix}.secureProtocols</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>TLSv1.2</code></td>
<td style="text-align:left">A (comma separated) list of secure protocols that are supported when negotiating TLS sessions. Please refer to the <a href="https://vertx.io/docs/vertx-core/java/#ssl">vert.x documentation</a> for a list of supported protocol names.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_TLSENABLED</code><br><code>--${prefix}.tlsEnabled</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>false</code></td>
<td style="text-align:left">If set to <code>true</code> the connection to the peer will be encrypted using TLS and the peer&rsquo;s identity will be verified using the JVM&rsquo;s configured standard trust store.<br>This variable only needs to be set to enable TLS explicitly if no specific trust store is configured using the <code>${PREFIX}_TRUSTSTOREPATH</code> variable.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_TRUSTSTOREPATH</code><br><code>--${prefix}.trustStorePath</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left">-</td>
<td style="text-align:left">The absolute path to the Java key store containing the CA certificates the adapter uses for authenticating the service. This property <strong>must</strong> be set if the service has been configured to support TLS. The key store format can be either <code>JKS</code>, <code>PKCS12</code> or <code>PEM</code> indicated by a <code>.jks</code>, <code>.p12</code> or <code>.pem</code> file suffix respectively.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_TRUSTSTOREPASSWORD</code><br><code>--${prefix}.trustStorePassword</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left">-</td>
<td style="text-align:left">The password required to read the contents of the trust store.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_USERNAME</code><br><code>--${prefix}.username</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left">-</td>
<td style="text-align:left">The username to use for authenticating to the service. This property (and the corresponding <em>password</em>) needs to be set in order to enable <em>SASL Plain</em> based authentication to the service.</td>
</tr>
</tbody>
</table>
<h2 id="response-caching">Response Caching</h2>
<p>The clients created by a Hono client factory support the caching of responses received in response to service invocations. Caching can greatly improve performance by preventing costly invocations of remote service operations. However, it usually only makes sense for resources that do not change too frequently. The Hono client follows the <a href="https://tools.ietf.org/html/rfc2616#section-13.4">approach to caching used in HTTP 1.1</a>. In particular, it supports <a href="https://tools.ietf.org/html/rfc2616#section-14.9"><em>cache directives</em></a> that a service includes in the response messages it sends back to the Hono client.</p>
<p>In order to enable caching, the <code>org.eclipse.hono.client.impl.HonoClientImpl</code> factory class needs to be configured with a cache manager using the <em>setCacheManager</em> method. Any specific client created by the factory will then cache responses to service invocations based on the following rules:</p>
<ol>
<li>If the response contains a <code>no-cache</code> directive, the response is not cached at all.</li>
<li>Otherwise, if the response contains a <code>max-age</code> directive, the response is cached for the number of seconds specified by the directive.</li>
<li>Otherwise, if the response message does not contain any of the above directives and the response&rsquo;s status code is one of the codes defined in <a href="https://tools.ietf.org/html/rfc2616#section-13.4">RFC 2616, Section 13.4 Response Cacheability</a>, the response is put to the cache using the default timeout defined by the <code>${PREFIX}_RESPONSECACHEDEFAULTTIMEOUT</code> variable as the maximum age.</li>
</ol>
<p>The following table provides an overview of the configuration variables and corresponding command line options for configuring the Hono client&rsquo;s caching behavior.</p>
<table>
<thead>
<tr>
<th style="text-align:left">Environment Variable<br>Command Line Option</th>
<th style="text-align:center">Mandatory</th>
<th style="text-align:left">Default Value</th>
<th style="text-align:left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>${PREFIX}_RESPONSECACHEMINSIZE</code><br><code>--${prefix}.responseCacheMinSize</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>20</code></td>
<td style="text-align:left">The minimum number of responses that can be cached.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_RESPONSECACHEMAXSIZE</code><br><code>--${prefix}.responseCacheMaxSize</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>1000</code></td>
<td style="text-align:left">The maximum number of responses that can be cached. It is up to the particular cache implementation, how to deal with new cache entries once this limit has been reached.</td>
</tr>
<tr>
<td style="text-align:left"><code>${PREFIX}_RESPONSECACHEDEFAULTTIMEOUT</code><br><code>--${prefix}.responseCacheDefaultTimeout</code></td>
<td style="text-align:center">no</td>
<td style="text-align:left"><code>600</code></td>
<td style="text-align:left">The default number of seconds after which cached responses should be considered invalid.</td>
</tr>
</tbody>
</table>
<h2 id="using-tls">Using TLS</h2>
<p>The factory can be configured to use TLS for</p>
<ul>
<li>authenticating the server during connection establishment and</li>
<li>(optionally) authenticating to the server using a client certificate (if the server supports this)</li>
</ul>
<p>In order to authenticate the server by means of the server&rsquo;s certificate, the factory needs to be configured with a <em>trust anchor</em> containing the <em>certificate authorities</em> that the client trusts. The trust anchor can be configured explicitly by means of the <code>${PREFIX}_TRUSTSTOREPATH</code> and <code>${PREFIX}_TRUSTSTOREPASSWORD</code> variables. This is most useful in cases where the server&rsquo;s certificate has not been signed by one of the public root CAs that are contained in the JRE&rsquo;s standard trust store. However, if the server does use a certificate signed by such a public CA, then it is sufficient to set the <code>${PREFIX}_TLSENABLED</code> variable to <code>true</code> in order for the client to support TLS when connecting to the server.</p>
<p>The client can also be configured to authenticate to the server by means of an X.509 client certificate if the server is configured to support this. The <code>${PREFIX}_CERTPATH</code> and <code>${PREFIX}_KEYPATH</code> variables can be used to set the paths to PEM files containing the certificate and private key. Alternatively, the <code>${PREFIX}_KEYSTOREPATH</code> and <code>${PREFIX}_KEYSTOREPASSWORD</code> variables can be used to set the path and password of a key store which contains both the certificate as well as the private key.</p>
<p>The factory supports TLS 1.2 only by default for negotiating TLS sessions with servers. Additional protocols can be enabled by setting the <code>${PREFIX}_SECUREPROTOCOLS</code> variable to a comma separated list of protocol names as defined in the <a href="https://vertx.io/docs/vertx-core/java/#ssl">vert.x documentation</a>. However, great care should be taken when enabling older protocols because most of them are vulnerable to attacks.</p>
<footer class="footline">
</footer>
</div>
</div>
<div id="navigation">
</div>
</section>
<div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
<div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
</div>
<script src="/hono/docs/js/clipboard.min.js?1626138731"></script>
<script src="/hono/docs/js/perfect-scrollbar.min.js?1626138731"></script>
<script src="/hono/docs/js/perfect-scrollbar.jquery.min.js?1626138731"></script>
<script src="/hono/docs/js/jquery.sticky.js?1626138731"></script>
<script src="/hono/docs/js/featherlight.min.js?1626138731"></script>
<script src="/hono/docs/js/highlight.pack.js?1626138731"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/hono/docs/js/modernizr.custom-3.6.0.js?1626138731"></script>
<script src="/hono/docs/js/learn.js?1626138731"></script>
<script src="/hono/docs/js/hugo-learn.js?1626138731"></script>
<link href="/hono/docs/mermaid/mermaid.css?1626138731" rel="stylesheet" />
<script src="/hono/docs/mermaid/mermaid.js?1626138731"></script>
<script>
mermaid.initialize({ startOnLoad: true });
</script>
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5WLCZXC');
</script>
<script src="https://www.eclipse.org/eclipse.org-common/themes/solstice/public/javascript/vendor/cookieconsent/default.min.js"></script>
</body>
</html>