<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
	xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.1.0"
	xsi:schemaLocation="
		http://www.osgi.org/xmlns/blueprint/v1.0.0 
		http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd

		http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0
		http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd

		http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.1.0
		http://aries.apache.org/schemas/blueprint-ext/blueprint-ext-1.1.xsd
">

	<bean id="syslogConnectionHandlerCamel" class="org.opennms.netmgt.syslogd.SyslogConnectionHandlerCamelImpl">
		<argument value="seda:handleMessage"/>
	</bean>

	<service interface="org.opennms.netmgt.syslogd.SyslogConnectionHandler" ref="syslogConnectionHandlerCamel"/>

	<!-- Camel Event marshalling processor -->
	<bean id="marshaller" class="org.opennms.core.camel.JaxbUtilsMarshalProcessor">
		<argument value="org.opennms.netmgt.syslogd.SyslogConnection" />
	</bean>

	<!-- ActiveMQ component provided by minion-core -->
	<reference id="queuingservice" interface="org.apache.camel.Component" filter="(alias=opennms.broker)"/>

	<camelContext id="syslogConnectionHandlerMinion" xmlns="http://camel.apache.org/schema/blueprint">
		<route id="syslogHandleMessage">
			<from uri="seda:handleMessage?concurrentConsumers=4" />
			<!-- Marshal the message to XML -->
			<bean ref="marshaller"/>
			<to uri="seda:sendMessage"/>
		</route>
		<route id="syslogSendMessage">
			<!-- Concurrent consumers gives a performance boost here because we have pooled connections to the JMS broker -->
			<from uri="seda:sendMessage?concurrentConsumers=4"/>
			<!-- Broadcast the message over ActiveMQ -->
			<!--
				Turn off persistent messages to avoid the latency penalty: 
				http://activemq.apache.org/async-sends.html
			-->
			<to uri="queuingservice:broadcastSyslog?deliveryPersistent=false"/>
		</route>
	</camelContext>

</blueprint>
