Skip to content

XML Configuration Example

assimbly edited this page Mar 20, 2018 · 10 revisions
<?xml version="1.0" encoding="UTF-8"?>
<connector>
	<id>example</id>
	<flows>

		<!-- FILE Producer Examples -->

		<!-- example file to wastebin -->
		<flow>
			<id>exampe.filetowastebin</id>
			<from>
				<uri>file://C:/Test1</uri>
			</from>
			<to>
				<uri>wastebin</uri>
			</to>	
		</flow>
		
		<!-- example file to file --> 		
		<flow>
			<id>example.filetofile</id>
			<from>
				<uri>file://C:/Test1</uri>
			</from>
			<to>
				<uri>file://C:/Test2</uri>
			</to>
		</flow>

		<!-- example file to streamm (prints message) --> 		
		<flow>
			<id>example.filetostream</id>
			<from>
				<uri>file://C:/Test1</uri>
			</from>
			<to>
				<uri>stream:out</uri>
			</to>
		</flow>

		<!-- example file to sonicmq --> 		
		<flow>
			<id>example.filetosonicmq</id>
			<from>
				<uri>file://C:/Test1</uri>
			</from>
			<to>
				<uri>sonicmq:Sample.Q1</uri>
				<options>
					<jmsMessageType>text</jmsMessageType>
				</options>
				<connection_id>local.mgmt</connection_id>
			</to>
			<error>
				<uri>file://C:/Test2</uri>
			</error>
		</flow>

		<!-- example file to sftp  -->
		<flow>
			<id>example.filetosftp</id>
			<from>
				<uri>file://C:/Test1</uri>
			</from>			
			<to>
				<uri>sftp://username@server/directory</uri>
				<options>
					<password>S0n1c2015!</password>
				</options>
			</to>	
		</flow>

		<!-- example file to sql  -->
		<flow>
			<id>example.filetosql</id>
			<from>
				<uri>file://C:/Test1</uri>
			</from>			
			<to>
				<uri>sql:insert into history (MESSAGE,`DATE`,MESSAGE_ID,TYPE) values (:#message,:#date,:#message_id,:#type)</uri>
				<options>
					<dataSource>test.db</dataSource>					
				</options>
				<connection_id>test.db</connection_id>
				<header_id>mapper</header_id>
			</to>	
		</flow>
					
	</flows>
	
	<!-- connections with for example MQ or Databases -->
	<services>
		<service>
			<id>local.mgmt</id>
			<username>Administrator</username>
			<password>Administrator</password>
			<url>tcp://localhost:2506</url>
		</service>
		
		<service>
			<id>test.db</id>
			<username>username</username>
			<password>example</password>
			<url>jdbc:mysql://localhost/dbname</url>
			<driver>com.mysql.jdbc.Driver</driver>
		</service>		
	</services>
	
	<!-- headers -->
	<headers>
		<header>
			<id>mapper</id>
			<x type="constant">y</x>
			<message type="xpath">/root/message/text()</message>
			<date type="xpath">/root/date/text()</date>
			<message_id type="xpath">/root/message_id/text()</message_id>
			<type type="xpath">/root/type/text()</type>
		</header>
	</headers>
		
</connector>
Clone this wiki locally