modules/clients/config/grid-client-spring-config.xml (27 lines of code) (raw):

<?xml version="1.0" encoding="UTF-8"?> <!-- 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. --> <!-- Ignite Client Spring configuration file to start grid client. When starting Ignite Client from Java IDE, pass configuration bean into GridClientFactory: GridClientFactory.start(new FileSystemXmlApplicationContext( "/path/to/grid-client-spring-config.xml").getBean(GridClientConfiguration.class)); --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <!-- Optional description. --> <description> Spring file for grid client configuration. </description> <!-- Configuration below demonstrates how to setup caches within grid nodes. --> <bean id="grid.client.cfg" class="org.apache.ignite.internal.client.GridClientConfiguration"> <!-- Data configurations. --> <property name="dataConfigurations"> <list> <bean class="org.apache.ignite.internal.client.GridClientDataConfiguration"> <property name="name" value="partitioned"/> <property name="affinity"> <bean class="org.apache.ignite.internal.client.GridClientPartitionAffinity"/> </property> </bean> </list> </property> <!-- The list of servers this client should connect to. --> <property name="servers"> <list> <value>127.0.0.1:11211</value> </list> </property> <!-- Client credentials used in authentication process. --> <!--<property name="credentials" value="s3cret"/>--> </bean> </beans>