blob: 254b7cc30a48b96050004d265c3e68de72dde67e [file] [log] [blame]
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-1382082-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-61232409-1');
</script>
<meta charset="UTF-8">
<title>Apache Ignite with Spring Transactions | Ignite Documentation</title>
<link rel="canonical" href="/docs/spring/spring-tx" />
<link rel="stylesheet" href="/assets/css/styles.css?1658382976">
<link rel="stylesheet" href="/assets/css/asciidoc-pygments.css">
<link rel="shortcut icon" href="/favicon.ico">
<meta name='viewport' content='width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0'>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="/assets/js/jquery.swiftype.autocomplete.js?1658382976"></script>
<script type="text/javascript" src="/assets/js/anchor.min.js?1658382976"></script>
</head>
<body>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<header>
<!--#include virtual="/includes/promotion_banner.html" -->
<div class="container">
<button type='button' class='menu' title='Docs menu'>
<img src="{{'assets/images/menu-icon.svg'|relative_url}}" width="18" height="12" alt="menu icon" />
</button>
<div class='home'>
<a href="/" class='home' title='Apache Ignite home'>
<img src="{{'assets/images/apache_ignite_logo.svg'|relative_url}}" alt="Apache Ignite logo" width="103" height="36" >
</a>
</div>
<form class='search'>
<button class="search-close" type='button'><img src='{{"assets/images/cancel.svg"|relative_url}}' alt="close" width="10" height="10" /></button>
<input type="search" placeholder="Search…" id="search-input">
</form>
<button type='button' class='top-nav-toggle'></button>
</div>
</header>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<link rel="stylesheet" href="/assets/css/docs.css">
<section class='page-docs'>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<nav class='left-nav' data-swiftype-index='false'>
<li>
<a href="/docs/extensions/aws/aws" class=''>Amazon S3 IP Finder</a>
</li>
<li>
<a href="/docs/extensions/camel/camel-streamer" class=''>Apache Camel Streamer</a>
</li>
<li>
<a href="/docs/extensions/flink/flink-streamer" class=''>Apache Flink Streamer</a>
</li>
<li>
<a href="/docs/extensions/flume/flume-sink" class=''>Apache Flume Sink</a>
</li>
<li>
<a href="/docs/extensions/azure/azure" class=''>Apache Ignite Azure Module</a>
</li>
<li>
<a href="/docs/extensions/gce/gce" class=''>Apache Ignite GCE Module</a>
</li>
<li>
<a href="/docs/extensions/pub-sub/pub-sub" class=''>Apache Ignite Pub/Sub Module</a>
</li>
<li>
<a href="/docs/extensions/spring/spring-boot" class=''>Apache Ignite and Spring Boot</a>
</li>
<li>
<a href="/docs/extensions/spring/spring-data" class=''>Apache Ignite and Spring Data</a>
</li>
<li>
<a href="/docs/extensions/spring/spring-caching" class=''>Apache Ignite and Spring Cache</a>
</li>
<li>
<a href="/docs/extensions/spring/spring-sessions" class=''>Apache Ignite and Spring Session</a>
</li>
<li>
<a href="/docs/extensions/spring/spring-tx" class=''>Apache Ignite and Spring Transactions</a>
</li>
<li>
<a href="/docs/extensions/kafka/kafka-streamer" class=''>Apache Kafka Streamer</a>
</li>
<li>
<a href="/docs/extensions/storm/storm-streamer" class=''>Apache Storm Streamer</a>
</li>
<li>
<a href="/docs/extensions/cdc/change-data-capture-extensions" class=''>Change Data Capture Extension</a>
</li>
<li>
<a href="/docs/extensions/jms/jms-streamer" class=''>JMS Streamer</a>
</li>
<li>
<a href="/docs/extensions/mqtt/mqtt-streamer" class=''>MQTT Streamer</a>
</li>
<li>
<a href="/docs/extensions/perf-statistics/performance-statistics" class=''>Performance Statistics Extension</a>
</li>
<li>
<a href="/docs/extensions/rocketmq/rocketmq-streamer" class=''>RocketMQ Streamer</a>
</li>
<li>
<a href="/docs/extensions/topology-validator/topology-validator" class=''>Topology Validator</a>
</li>
<li>
<a href="/docs/extensions/twitter/twitter-streamer" class=''>Twitter Streamer</a>
</li>
<li>
<a href="/docs/extensions/zeromq/zeromq-streamer" class=''>ZeroMQ Streamer</a>
</li>
<li>
<a href="/docs/extensions/zookeeper/zookeeper-ip" class=''>ZooKeeper IP Finder</a>
</li>
</nav>
<div class="left-nav__overlay"></div>
<article data-swiftype-index='true'>
<a class='edit-link' href="/_docs/spring/spring-tx.adoc" target="_blank">Edit</a>
<h1>Apache Ignite with Spring Transactions</h1>
<div class="sect1">
<h2 id="overview">Overview</h2>
<div class="sectionbody">
<div class="paragraph">
<p><a href="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/transaction.html" target="_blank" rel="noopener">Spring Transactions</a>
abstraction allows you to use a declarative transaction management to concentrate on business logic rather than
transaction life-cycle.</p>
</div>
<div class="paragraph">
<p>Apache Ignite provides the <code>ignite-spring-tx-ext</code> extension that allows to manage
<a href="https://ignite.apache.org/docs/latest/key-value-api/transactions#performing-transactions" target="_blank" rel="noopener">Apache Ignite Transactions</a>
through the Spring Transactions abstraction. The mentioned above integration is achieved by providing implementations of the
<code>TransactionManager</code> Spring Transactions interface. There are two such implementations: <code>SpringTransactionManager</code> and
<code>IgniteClientSpringTransactionManager</code>, which use either Apache Ignite node or Apache Ignite thin client to connect to the
Apache Ignite cluster and manage the Apache Ignite transactions.</p>
</div>
<div class="paragraph">
<p>To enable declarative transaction management in your Spring application, create and configure
<code>SpringTransactionManager</code> or <code>IgniteClientSpringTransactionManager</code> bean in the Spring application context. The choice
of implementation depends on your preferable way to access the Apache Ignite cluster.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="maven-configuration">Maven Configuration</h2>
<div class="sectionbody">
<div class="paragraph">
<p>If you use Maven to manage dependencies in your project, you can add Spring Transactions extension dependencies to
the application&#8217;s <code>pom.xml</code> file like this:</p>
</div>
<code-tabs><code-tab data-tab='For all Apache Ignite versions since 2.12.0'><div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="xml"><span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.apache.ignite<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>ignite-spring-tx-ext<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>${ignite-spring-tx-ext.version}<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;/dependency&gt;</span>
<span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.apache.ignite<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>ignite-core<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>${ignite.version}<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;/dependency&gt;</span>
<span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.apache.ignite<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>ignite-spring<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>${ignite.version}<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;exclusions&gt;</span>
<span class="nt">&lt;exclusion&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.springframework<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>spring-context<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;/exclusion&gt;</span>
<span class="nt">&lt;/exclusions&gt;</span>
<span class="nt">&lt;/dependency&gt;</span>
<span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.springframework<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>spring-context<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>${spring.version}<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;/dependency&gt;</span>
<span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.springframework<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>spring-tx<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>${spring.version}<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;/dependency&gt;</span></code></pre>
</div>
</div></code-tab><code-tab data-tab=' For Apache Ignite 2.11.0'><div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="xml"><span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.apache.ignite<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>ignite-spring-tx-ext<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>${ignite-spring-tx-ext.version}<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;/dependency&gt;</span>
<span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.apache.ignite<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>ignite-core<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>${ignite.version}<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;/dependency&gt;</span>
<span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.apache.ignite<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>ignite-spring<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>${ignite.version}<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;exclusions&gt;</span>
<span class="nt">&lt;exclusion&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.springframework<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>spring-context<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;/exclusion&gt;</span>
<span class="nt">&lt;exclusion&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.springframework<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>spring-core<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;/exclusion&gt;</span>
<span class="nt">&lt;exclusion&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.springframework<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>spring-aop<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;/exclusion&gt;</span>
<span class="nt">&lt;exclusion&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.springframework<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>spring-expressions<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;/exclusion&gt;</span>
<span class="nt">&lt;exclusion&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.springframework<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>spring-beans<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;/exclusion&gt;</span>
<span class="nt">&lt;exclusion&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.springframework<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>spring-jdbc<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;/exclusion&gt;</span>
<span class="nt">&lt;exclusion&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.springframework<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>spring-tx<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;/exclusion&gt;</span>
<span class="nt">&lt;/exclusions&gt;</span>
<span class="nt">&lt;/dependency&gt;</span>
<span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.springframework<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>spring-context<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>${spring.version}<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;/dependency&gt;</span>
<span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.springframework<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>spring-tx<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>${spring.version}<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;/dependency&gt;</span></code></pre>
</div>
</div></code-tab></code-tabs>
<div class="paragraph">
<p>Replace <code>${ignite-spring-tx-ext.version}</code>, <code>${spring.version}</code>, and
<code>${ignite.version}</code> with an actual version of Apache Ignite Spring Transactions extension, Spring, and
Apache Ignite dependency you need, respectively.</p>
</div>
<div class="paragraph">
<p>The table below shows available versions of the Apache Ignite Spring Transactions extension and compatible versions
of the Apache Ignite and Spring.</p>
</div>
<table class="tableblock frame-all grid-all stripes-even stretch">
<colgroup>
<col style="width: 28.5714%;">
<col style="width: 35.7142%;">
<col style="width: 35.7144%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Apache Ignite Spring Transactions extension version</th>
<th class="tableblock halign-left valign-top">Apache Ignite versions</th>
<th class="tableblock halign-left valign-top">Spring versions</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">1.0.0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">All versions since 2.11.0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">All versions since 4.3.0</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect1">
<h2 id="apache-ignite-node-transaction-manager-configuration">Apache Ignite Node Transaction Manager Configuration</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This chapter shows how to set up <code>SpringTransactionManager</code> that relies on Apache Ignite node to connect to the cluster
and to manage transactions. The configuration consists of two steps -
<a href="/docs/extensions/extensions-and-integrations/spring/spring-tx#cluster-connection-configuration">Cluster connection configuration</a>
and <a href="/docs/extensions/extensions-and-integrations/spring/spring-tx#transaction-concurrency-mode-configuration">Transaction concurrency mode configuration</a>.</p>
</div>
<div class="sect2">
<h3 id="cluster-connection-configuration">Cluster Connection Configuration</h3>
<div class="paragraph">
<p>Cluster connection configuration defines Apache Ignite node used by <code>SpringTransactionManager</code> to access the cluster.
There are several approaches to do this:</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">
<div class="paragraph">
<p>Mixing of multiple approaches is incorrect and results in the exception during the manager startup.</p>
</div>
</td>
</tr>
</table>
</div>
<h3 id="1-specifying-name-of-the-manually-started-apache-ignite-node-instance" class="discrete">1. Specifying Name of the Manually Started Apache Ignite Node Instance</h3>
<div class="paragraph">
<p>This approach is suitable if you have Apache Ignite node instance already running in your application.</p>
</div>
<code-tabs><code-tab data-tab='Java'><div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="java"><span class="nd">@Configuration</span>
<span class="nd">@EnableTransactionManagement</span>
<span class="kd">public</span> <span class="kd">class</span> <span class="nc">SpringApplicationConfiguration</span> <span class="o">{</span>
<span class="nd">@Bean</span>
<span class="kd">public</span> <span class="nc">SpringTransactionManager</span> <span class="nf">transactionManager</span><span class="o">()</span> <span class="o">{</span>
<span class="nc">SpringTransactionManager</span> <span class="n">mgr</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">SpringTransactionManager</span><span class="o">();</span>
<span class="n">mgr</span><span class="o">.</span><span class="na">setIgniteInstanceName</span><span class="o">(</span><span class="s">"&lt;name of the Apache Ignite node instance&gt;"</span><span class="o">);</span>
<span class="k">return</span> <span class="n">mgr</span><span class="o">;</span>
<span class="o">}</span>
<span class="o">}</span></code></pre>
</div>
</div></code-tab><code-tab data-tab='XML'><div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="xml"><span class="nt">&lt;beans</span> <span class="na">xmlns=</span><span class="s">"http://www.springframework.org/schema/beans"</span>
<span class="na">xmlns:xsi=</span><span class="s">"http://www.w3.org/2001/XMLSchema-instance"</span>
<span class="na">xmlns:tx=</span><span class="s">"http://www.springframework.org/schema/tx"</span>
<span class="na">xsi:schemaLocation=</span><span class="s">"
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"</span><span class="nt">&gt;</span>
<span class="c">&lt;!-- Provide Apache Ignite instance name. --&gt;</span>
<span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">"transactionManager"</span> <span class="na">class=</span><span class="s">"org.apache.ignite.transactions.spring.SpringTransactionManager"</span><span class="nt">&gt;</span>
<span class="nt">&lt;property</span>
<span class="na">name=</span><span class="s">"igniteInstanceName"</span>
<span class="na">value=</span><span class="s">"&lt;name of the Apache Ignite node instance&gt;"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/bean&gt;</span>
<span class="c">&lt;!-- Use annotation-driven transaction configuration. --&gt;</span>
<span class="nt">&lt;tx:annotation-driven/&gt;</span>
<span class="nt">&lt;/beans&gt;</span></code></pre>
</div>
</div></code-tab></code-tabs>
<h3 id="2-specifying-apache-ignite-node-configuration" class="discrete">2. Specifying Apache Ignite Node Configuration</h3>
<div class="paragraph">
<p>In this case, Apache Ignite node instance is started automatically by the manager based on the provided configuration.</p>
</div>
<code-tabs><code-tab data-tab='Java'><div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="java"><span class="nd">@Configuration</span>
<span class="nd">@EnableTransactionManagement</span>
<span class="kd">public</span> <span class="kd">class</span> <span class="nc">SpringApplicationConfiguration</span> <span class="o">{</span>
<span class="nd">@Bean</span>
<span class="kd">public</span> <span class="nc">SpringTransactionManager</span> <span class="nf">transactionManager</span><span class="o">()</span> <span class="o">{</span>
<span class="nc">SpringTransactionManager</span> <span class="n">mgr</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">SpringTransactionManager</span><span class="o">();</span>
<span class="n">mgr</span><span class="o">.</span><span class="na">setConfiguration</span><span class="o">(</span><span class="k">new</span> <span class="nc">IgniteConfiguration</span><span class="o">()</span>
<span class="o">.</span><span class="na">setIgniteInstanceName</span><span class="o">(</span><span class="s">"&lt;name of the Ignite node instance&gt;"</span><span class="o">)</span>
<span class="c1">// Other required configuration parameters.</span>
<span class="o">);</span>
<span class="k">return</span> <span class="n">mgr</span><span class="o">;</span>
<span class="o">}</span>
<span class="o">}</span></code></pre>
</div>
</div></code-tab><code-tab data-tab='XML'><div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="xml"><span class="nt">&lt;beans</span> <span class="na">xmlns=</span><span class="s">"http://www.springframework.org/schema/beans"</span>
<span class="na">xmlns:xsi=</span><span class="s">"http://www.w3.org/2001/XMLSchema-instance"</span>
<span class="na">xmlns:tx=</span><span class="s">"http://www.springframework.org/schema/tx"</span>
<span class="na">xsi:schemaLocation=</span><span class="s">"
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"</span><span class="nt">&gt;</span>
<span class="c">&lt;!-- Provide configuration bean. --&gt;</span>
<span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">"transactionManager"</span> <span class="na">class=</span><span class="s">"org.apache.ignite.transactions.spring.SpringTransactionManager"</span><span class="nt">&gt;</span>
<span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">"configuration"</span><span class="nt">&gt;</span>
<span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">"gridCfg"</span> <span class="na">class=</span><span class="s">"org.apache.ignite.configuration.IgniteConfiguration"</span><span class="nt">&gt;</span>
...
<span class="nt">&lt;/bean&gt;</span>
<span class="nt">&lt;/property&gt;</span>
<span class="nt">&lt;/bean&gt;</span>
<span class="c">&lt;!-- Use annotation-driven transaction configuration. --&gt;</span>
<span class="nt">&lt;tx:annotation-driven/&gt;</span>
<span class="nt">&lt;/beans&gt;</span></code></pre>
</div>
</div></code-tab></code-tabs>
<h3 id="3-specifying-path-to-apache-ignite-xml-node-configuration-file" class="discrete">3. Specifying Path to Apache Ignite XML Node Configuration File</h3>
<div class="paragraph">
<p>In this case, Apache Ignite node instance is started automatically by the manager based on the provided configuration.</p>
</div>
<code-tabs><code-tab data-tab='Java'><div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="java"><span class="nd">@Configuration</span>
<span class="nd">@EnableTransactionManagement</span>
<span class="kd">public</span> <span class="kd">class</span> <span class="nc">SpringApplicationConfiguration</span> <span class="o">{</span>
<span class="nd">@Bean</span>
<span class="kd">public</span> <span class="nc">SpringTransactionManager</span> <span class="nf">transactionManager</span><span class="o">()</span> <span class="o">{</span>
<span class="nc">SpringTransactionManager</span> <span class="n">mgr</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">SpringTransactionManager</span><span class="o">();</span>
<span class="n">mgr</span><span class="o">.</span><span class="na">setConfigurationPath</span><span class="o">(</span><span class="s">"&lt;path to an Apache Ignite configuration XML file (path can be absolute or relative to `IGNITE_HOME`)&gt;"</span><span class="o">)</span>
<span class="k">return</span> <span class="n">mgr</span><span class="o">;</span>
<span class="o">}</span>
<span class="o">}</span></code></pre>
</div>
</div></code-tab><code-tab data-tab='XML'><div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="xml"><span class="nt">&lt;beans</span> <span class="na">xmlns=</span><span class="s">"http://www.springframework.org/schema/beans"</span>
<span class="na">xmlns:xsi=</span><span class="s">"http://www.w3.org/2001/XMLSchema-instance"</span>
<span class="na">xmlns:tx=</span><span class="s">"http://www.springframework.org/schema/tx"</span>
<span class="na">xsi:schemaLocation=</span><span class="s">"
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"</span><span class="nt">&gt;</span>
<span class="c">&lt;!-- Provide configuration file path. --&gt;</span>
<span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">"transactionManager"</span> <span class="na">class=</span><span class="s">"org.apache.ignite.transactions.spring.SpringTransactionManager"</span><span class="nt">&gt;</span>
<span class="nt">&lt;property</span>
<span class="na">name=</span><span class="s">"configurationPath"</span>
<span class="na">value=</span><span class="s">"&lt;path to an Apache Ignite configuration XML file (path can be absolute or relative to `IGNITE_HOME`)"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/bean&gt;</span>
<span class="c">&lt;!-- Use annotation-driven transaction configuration. --&gt;</span>
<span class="nt">&lt;tx:annotation-driven/&gt;</span>
<span class="nt">&lt;/beans&gt;</span></code></pre>
</div>
</div></code-tab></code-tabs>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">
<div class="paragraph">
<p>If no connection configuration is specified, <code>SpringTransactionManager</code> uses Apache Ignite node instance with the
default name. If it does not exist, an exception is thrown during the <code>SpringTransactionManager</code> startup.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<div class="title">Important</div>
</td>
<td class="content">
<div class="paragraph">
<p>Regardless the configuration approach you chose, the same Apache Ignite node instance must be used to initialize the
transaction manager and perform the transactional operations. In case Apache Ignite node was started by the transaction manager,
you can obtain its instance in your application through <code>Ignition.ignite("&lt;name of the Apache Ignite node instance&gt;");</code>.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="sect2">
<h3 id="transaction-concurrency-mode-configuration">Transaction Concurrency Mode Configuration</h3>
<div class="paragraph">
<p>The transaction concurrency mode configuration defines the
<a href="https://ignite.apache.org/docs/latest/key-value-api/transactions#concurrency-modes-and-isolation-levels" target="_blank" rel="noopener">Apache Ignite transaction concurrency mode</a>
that a manager will apply to all transactions that it processes.</p>
</div>
<code-tabs><code-tab data-tab='Java'><div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="java"><span class="nd">@Configuration</span>
<span class="nd">@EnableTransactionManagement</span>
<span class="kd">public</span> <span class="kd">class</span> <span class="nc">SpringApplicationConfiguration</span> <span class="o">{</span>
<span class="nd">@Bean</span>
<span class="kd">public</span> <span class="nc">SpringTransactionManager</span> <span class="nf">transactionManager</span><span class="o">()</span> <span class="o">{</span>
<span class="nc">SpringTransactionManager</span> <span class="n">mgr</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">SpringTransactionManager</span><span class="o">();</span>
<span class="n">mgr</span><span class="o">.</span><span class="na">setTransactionConcurrency</span><span class="o">(</span><span class="nc">TransactionConcurrency</span><span class="o">.</span><span class="na">OPTIMISTIC</span><span class="o">);</span>
<span class="k">return</span> <span class="n">mgr</span><span class="o">;</span>
<span class="o">}</span>
<span class="o">}</span></code></pre>
</div>
</div></code-tab><code-tab data-tab='XML'><div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="xml"><span class="nt">&lt;beans</span> <span class="na">xmlns=</span><span class="s">"http://www.springframework.org/schema/beans"</span>
<span class="na">xmlns:xsi=</span><span class="s">"http://www.w3.org/2001/XMLSchema-instance"</span>
<span class="na">xmlns:tx=</span><span class="s">"http://www.springframework.org/schema/tx"</span>
<span class="na">xsi:schemaLocation=</span><span class="s">"
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"</span><span class="nt">&gt;</span>
<span class="c">&lt;!-- Provide Apache Ignite instance name. --&gt;</span>
<span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">"transactionManager"</span> <span class="na">class=</span><span class="s">"org.apache.ignite.transactions.spring.SpringTransactionManager"</span><span class="nt">&gt;</span>
<span class="c">&lt;!-- Here is appropriate connection configuration. --&gt;</span>
<span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">"transactionConcurrency"</span> <span class="na">value=</span><span class="s">"OPTIMISTIC"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/bean&gt;</span>
<span class="c">&lt;!-- Use annotation-driven transaction configuration. --&gt;</span>
<span class="nt">&lt;tx:annotation-driven/&gt;</span>
<span class="nt">&lt;/beans&gt;</span></code></pre>
</div>
</div></code-tab></code-tabs>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">
<div class="paragraph">
<p>If no transaction concurrency mode configuration is specified, <code>PESSIMISTIC</code> concurrency mode is used.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>In case you need to support multiple transaction concurrency modes in your application, create separate
transaction managers for each transaction concurrency mode that you need, and for each Spring transaction specify the
manager that will process it.</p>
</div>
<code-tabs><code-tab data-tab='Java'><div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="java"><span class="nd">@Configuration</span>
<span class="nd">@EnableTransactionManagement</span>
<span class="kd">public</span> <span class="kd">class</span> <span class="nc">SpringApplicationConfiguration</span> <span class="o">{</span>
<span class="nd">@Bean</span>
<span class="kd">public</span> <span class="nc">SpringTransactionManager</span> <span class="nf">pessimisticTransactionManager</span><span class="o">()</span> <span class="o">{</span>
<span class="nc">SpringTransactionManager</span> <span class="n">mgr</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">SpringTransactionManager</span><span class="o">();</span>
<span class="n">mgr</span><span class="o">.</span><span class="na">setTransactionConcurrency</span><span class="o">(</span><span class="nc">TransactionConcurrency</span><span class="o">.</span><span class="na">PESSIMISTIC</span><span class="o">);</span>
<span class="k">return</span> <span class="n">mgr</span><span class="o">;</span>
<span class="o">}</span>
<span class="nd">@Bean</span>
<span class="kd">public</span> <span class="nc">SpringTransactionManager</span> <span class="nf">optimisticTransactionManager</span><span class="o">()</span> <span class="o">{</span>
<span class="nc">SpringTransactionManager</span> <span class="n">mgr</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">SpringTransactionManager</span><span class="o">();</span>
<span class="n">mgr</span><span class="o">.</span><span class="na">setTransactionConcurrency</span><span class="o">(</span><span class="nc">TransactionConcurrency</span><span class="o">.</span><span class="na">OPTIMISTIC</span><span class="o">);</span>
<span class="k">return</span> <span class="n">mgr</span><span class="o">;</span>
<span class="o">}</span>
<span class="o">}</span></code></pre>
</div>
</div></code-tab><code-tab data-tab='XML'><div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="xml"><span class="nt">&lt;beans</span> <span class="na">xmlns=</span><span class="s">"http://www.springframework.org/schema/beans"</span>
<span class="na">xmlns:xsi=</span><span class="s">"http://www.w3.org/2001/XMLSchema-instance"</span>
<span class="na">xmlns:tx=</span><span class="s">"http://www.springframework.org/schema/tx"</span>
<span class="na">xsi:schemaLocation=</span><span class="s">"
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"</span><span class="nt">&gt;</span>
<span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">"optimisticTransactionManager"</span> <span class="na">class=</span><span class="s">"org.apache.ignite.transactions.spring.SpringTransactionManager"</span><span class="nt">&gt;</span>
<span class="c">&lt;!-- Here is appropriate connection configuration --&gt;</span>
<span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">"transactionConcurrency"</span> <span class="na">value=</span><span class="s">"OPTIMISTIC"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/bean&gt;</span>
<span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">"pessimisticTransactionManager"</span> <span class="na">class=</span><span class="s">"org.apache.ignite.transactions.spring.SpringTransactionManager"</span><span class="nt">&gt;</span>
<span class="c">&lt;!-- Here is appropriate connection configuration configuration. --&gt;</span>
<span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">"transactionConcurrency"</span> <span class="na">value=</span><span class="s">"PESSIMISTIC"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/bean&gt;</span>
<span class="c">&lt;!-- Use annotation-driven transaction configuration. --&gt;</span>
<span class="nt">&lt;tx:annotation-driven/&gt;</span>
<span class="nt">&lt;/beans&gt;</span></code></pre>
</div>
</div></code-tab></code-tabs>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="java"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">TransactionalService</span> <span class="o">{</span>
<span class="nd">@Transactional</span><span class="o">(</span><span class="s">"optimisticTransactionManager"</span><span class="o">)</span>
<span class="kd">public</span> <span class="kt">void</span> <span class="nf">doOptimistically</span><span class="o">()</span> <span class="o">{</span>
<span class="c1">// Method body.</span>
<span class="o">}</span>
<span class="nd">@Transactional</span><span class="o">(</span><span class="s">"pessimisticTransactionManager"</span><span class="o">)</span>
<span class="kd">public</span> <span class="kt">void</span> <span class="nf">doPessimistically</span><span class="o">()</span> <span class="o">{</span>
<span class="c1">// Method body.</span>
<span class="o">}</span>
<span class="o">}</span></code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="apache-ignite-thin-client-transaction-manager-configuration">Apache Ignite Thin Client Transaction Manager Configuration</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This chapter shows how to set up <code>IgniteClientSpringTransactionManager</code> that relies on Ignite thin client to connect
to the cluster and manage transactions.</p>
</div>
<div class="sect2">
<h3 id="cluster-connection-configuration-2">Cluster Connection Configuration</h3>
<div class="paragraph">
<p>Cluster connection configuration defines Apache Ignite thin client instance used by <code>IgniteClientSpringTransactionManager</code>
to access the cluster.</p>
</div>
<code-tabs><code-tab data-tab='Java'><div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="java"><span class="nd">@Configuration</span>
<span class="nd">@EnableTransactionManagement</span>
<span class="kd">public</span> <span class="kd">static</span> <span class="kd">class</span> <span class="nc">SpringApplicationConfiguration</span> <span class="o">{</span>
<span class="nd">@Bean</span>
<span class="kd">public</span> <span class="nc">IgniteClient</span> <span class="nf">igniteClient</span><span class="o">()</span> <span class="o">{</span>
<span class="k">return</span> <span class="nc">Ignition</span><span class="o">.</span><span class="na">startClient</span><span class="o">(</span><span class="k">new</span> <span class="nc">ClientConfiguration</span><span class="o">().</span><span class="na">setAddresses</span><span class="o">(</span><span class="s">"127.0.0.1:10800"</span><span class="o">));</span>
<span class="o">}</span>
<span class="nd">@Bean</span>
<span class="kd">public</span> <span class="nc">IgniteClientSpringTransactionManager</span> <span class="nf">transactionManager</span><span class="o">(</span><span class="nc">IgniteClient</span> <span class="n">cli</span><span class="o">)</span> <span class="o">{</span>
<span class="nc">IgniteClientSpringTransactionManager</span> <span class="n">mgr</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">IgniteClientSpringTransactionManager</span><span class="o">();</span>
<span class="n">mgr</span><span class="o">.</span><span class="na">setClientInstance</span><span class="o">(</span><span class="n">cli</span><span class="o">);</span>
<span class="k">return</span> <span class="n">mgr</span><span class="o">;</span>
<span class="o">}</span>
<span class="o">}</span></code></pre>
</div>
</div></code-tab><code-tab data-tab='XML'><div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="xml"><span class="nt">&lt;beans</span> <span class="na">xmlns=</span><span class="s">"http://www.springframework.org/schema/beans"</span>
<span class="na">xmlns:xsi=</span><span class="s">"http://www.w3.org/2001/XMLSchema-instance"</span>
<span class="na">xmlns:tx=</span><span class="s">"http://www.springframework.org/schema/tx"</span>
<span class="na">xsi:schemaLocation=</span><span class="s">"
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"</span><span class="nt">&gt;</span>
<span class="c">&lt;!--
Note that org.apache.ignite.IgniteClientSpringBean is available since Apache Ignite 2.11.0 version.
For Apache Ignite 2.10.0 and earlier `org.apache.ignite.client.IgniteClient` bean should be created
manually with concern of its connection to the Ignite cluster.
--&gt;</span>
<span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">"igniteClient"</span> <span class="na">class=</span><span class="s">"org.apache.ignite.IgniteClientSpringBean"</span><span class="nt">&gt;</span>
<span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">"clientConfiguration"</span><span class="nt">&gt;</span>
<span class="nt">&lt;bean</span> <span class="na">class=</span><span class="s">"org.apache.ignite.configuration.ClientConfiguration"</span><span class="nt">&gt;</span>
<span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">"addresses"</span><span class="nt">&gt;</span>
<span class="nt">&lt;list&gt;</span>
<span class="nt">&lt;value&gt;</span>127.0.0.1:10800<span class="nt">&lt;/value&gt;</span>
<span class="nt">&lt;/list&gt;</span>
<span class="nt">&lt;/property&gt;</span>
<span class="nt">&lt;/bean&gt;</span>
<span class="nt">&lt;/property&gt;</span>
<span class="nt">&lt;/bean&gt;</span>
<span class="c">&lt;!-- Provide Apache Ignite client instance. --&gt;</span>
<span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">"transactionManager"</span> <span class="na">class=</span><span class="s">"org.apache.ignite.transactions.spring.IgniteClientSpringTransactionManager"</span><span class="nt">&gt;</span>
<span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">"clientInstance"</span> <span class="na">ref=</span><span class="s">"igniteClientBean"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/bean&gt;</span>
<span class="c">&lt;!-- Use annotation-driven transaction configuration. --&gt;</span>
<span class="nt">&lt;tx:annotation-driven/&gt;</span>
<span class="nt">&lt;/beans&gt;</span></code></pre>
</div>
</div></code-tab></code-tabs>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<div class="title">Important</div>
</td>
<td class="content">
<div class="paragraph">
<p>The same Apache Ignite thin client instance must be used to initialize the transaction manager and to perform
transactional operations.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="sect2">
<h3 id="transaction-concurrency-mode-configuration-2">Transaction Concurrency Mode Configuration</h3>
<div class="paragraph">
<p>Transaction concurrency mode configuration for <code>IgniteClientSpringTransactionManager</code> is performed the same way as for
<a href="/docs/extensions/extensions-and-integrations/spring/spring-tx#transaction-concurrency-mode-configuration">SpringTransactionManager</a>
that uses Apache Ignite node instance to access the cluster.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="examples">Examples</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The example of using Apache Ignite Spring Transactions integration is available on <a href="https://github.com/apache/ignite-extensions/tree/master/modules/spring-tx-ext/examples/main/java/org/apache/ignite/transactions/spring/examples" target="_blank" rel="noopener">GitHub</a>.</p>
</div>
</div>
</div>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="copyright">
© 2022 The Apache Software Foundation.<br/>
Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are either registered trademarks or trademarks of The Apache Software Foundation.
</div>
</article>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<nav class="right-nav" data-swiftype-index='false'>
<ul class="sectlevel1">
<li><a href="#overview">Overview</a></li>
<li><a href="#maven-configuration">Maven Configuration</a></li>
<li><a href="#apache-ignite-node-transaction-manager-configuration">Apache Ignite Node Transaction Manager Configuration</a>
<ul class="sectlevel2">
<li><a href="#cluster-connection-configuration">Cluster Connection Configuration</a></li>
<li><a href="#transaction-concurrency-mode-configuration">Transaction Concurrency Mode Configuration</a></li>
</ul>
</li>
<li><a href="#apache-ignite-thin-client-transaction-manager-configuration">Apache Ignite Thin Client Transaction Manager Configuration</a>
<ul class="sectlevel2">
<li><a href="#cluster-connection-configuration-2">Cluster Connection Configuration</a></li>
<li><a href="#transaction-concurrency-mode-configuration-2">Transaction Concurrency Mode Configuration</a></li>
</ul>
</li>
<li><a href="#examples">Examples</a></li>
</ul>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<footer>
</footer>
</nav>
</section>
<script type='module' src='/assets/js/code-copy-to-clipboard.js' async></script>
<script>
// inits deep anchors -- needs to be done here because of https://www.bryanbraun.com/anchorjs/#dont-run-it-too-late
anchors.add('.page-docs h1, .page-docs h2, .page-docs h3:not(.discrete), .page-docs h4, .page-docs h5');
anchors.options = {
placement: 'right',
visible: 'always'
};
</script>
</body>
<script type='module' src='/assets/js/index.js?1658382976' async></script>
</html>