Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can append query options to the URI in the following format, ?option=value&option=value&...

Component

The ApnsComponent must be configured with a com.notnoop.apns.ApnsService. The service can be created and configured using the org.apache.camel.component.apns.factory.ApnsServiceFactory. See further below for an example. And as well in the test source code.

Exchange data format

When Camel will fetch feedback data corresponding to inactive devices, it will retrieve a List of InactiveDevice objects. Each InactiveDevice object of the retrieved list will be setted as the In body, and then processed by the consumer endpoint.

...

Code Block
xml
xml
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:camel="http://camel.apache.org/schema/spring"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

	<!-- Replace by desired values -->
	<bean id="apnsServiceFactory" class="org.apache.camel.component.apns.factory.ApnsServiceFactory">

		<!-- Optional configuration of feedback host and port -->
		<!-- <property name="feedbackHost" value="localhost" /> -->
		<!-- <property name="feedbackPort" value="7843" /> -->

		<!-- Optional configuration of gateway host and port -->
		<!-- <property name="gatewayHost" value="localhost" /> -->
		<!-- <property name="gatewayPort" value="7654" /> -->

		<!-- Declaration of certificate used -->
		<property name="certificatePath" value="src/test/resources/certificate.p12" />
		                <!-- In case you wants from Camel 2.11 onwards you can use prefix: classpath:, file: to refer to load the certificate from classpath: or file. Default it classpath -->
		<!-- <property name="certificatePath" value="classpath:/certificate.p12" /> -->
		<property name="certificatePassword" value="MyCertPassword" />

		<!-- Optional connection strategy - By Default: No need to configure -->
		<!-- Possible options: NON_BLOCKING, QUEUE, POOL or Nothing -->
		<!-- <property name="connectionStrategy" value="POOL" /> -->
		<!-- Optional pool size -->
		<!-- <property name="poolSize" value="15" /> -->

		<!-- Optional connection strategy - By Default: No need to configure -->
		<!-- Possible options: EVERY_HALF_HOUR, EVERY_NOTIFICATION or Nothing (Corresponds to NEVER javapns option) -->
		<!-- <property name="reconnectionPolicy" value="EVERY_HALF_HOUR" /> -->
	</bean>

	<bean id="apnsService" factory-bean="apnsServiceFactory" factory-method="getApnsService" />

	<!-- Replace this declaration by wanted configuration -->
	<bean id="apns" class="org.apache.camel.component.apns.ApnsComponent">
		<property name="apnsService" ref="apnsService" />
	</bean>

	<camelContext id="camel-apns-test" xmlns="http://camel.apache.org/schema/spring">
        	<route id="apns-test">
                	<from uri="apns:consumer?initialDelay=10&amp;delay=3600&amp;timeUnit=SECONDS" />
        	        <to uri="log:org.apache.camel.component.apns?showAll=true&amp;multiline=true" />
                	<to uri="mock:result" />
        	</route>
	</camelContext>

</beans>

...