camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nsaran5 <nsar...@hotmail.com>
Subject Camel
Date Sun, 13 Nov 2016 03:31:29 GMT
Hello,

Getting the response back from apple as 

 {"reason":"BadDeviceToken"}
Need to validate as baddevice token and need to write into the queue
but some how it is directly going to the onException
can someone help on this.

Code snippet as follows.
<onException>
			<exception>java.lang.Exception</exception>
			<setHeader headerName="exception">
				<simple>${exception.stacktrace}</simple>
			</setHeader>
			<log message="
************************************************************************************Before
Service call" />
			
			<log
message="***************************************************************After
Service call" /> 
			<log loggingLevel="ERROR" message="Writing to error Queue -
${header.exception}" />
			<to uri="jms:queue:{{AmqEnv}}.{{messagingErrorQueue}}" />
		</onException>



<route id="iOSPriceDrop">
			<from uri="seda:iOSPriceDrop" />
			<log message="ios messsage" />
			<log message="Enterign IOS PRiceDrop log testing" />
			<camel:setHeader headerName="CamelApnsMessageType">
				<camel:constant>PAYLOAD</camel:constant>
			</camel:setHeader>
			<camel:setHeader headerName="appName">
				<xpath resultType="java.lang.String">/Notification/appId</xpath>
			</camel:setHeader>
			<camel:setHeader headerName="apns-topic">
				<simple>com.pointabout.cars</simple>
			</camel:setHeader>
			<camel:setProperty propertyName="DeactivateApnsTokens">
				<xpath resultType="java.lang.String">/Notification/deviceTokens</xpath>
			</camel:setProperty>
			<camel:setHeader headerName="CamelApnsTokens">
				<xpath resultType="java.lang.String">/Notification/deviceTokens</xpath>
			</camel:setHeader>
			<log message="Testing1 ${body}" />
			<camel:process ref="xmlToJsonProcessorForIos" />
			
			<log message="Got ${headers} and ${body}" />
			<choice>
				<when>
					<simple>${in.header.appName} == 'Carscom'</simple>
					<to
					
uri="log:org.apache.camel.component.apns?showAll=true&amp;multiline=true" />
					<log message="sending iOS notification" />
					<to uri="direct:ms_apnsSendNotification" />
					<setHeader headerName="response">
						<simple>${bodyAs(String)}}</simple>
					</setHeader>
					<camel:setBody>
						<simple>${header.response}</simple>
					</camel:setBody>
					<choice>
						<camel:when>
							<simple>${bodyAs(String)} contains 'reason'</simple>
							<log message=" Coming Error section" />
							<log loggingLevel="ERROR"
								message="Writing to sarav Queue - ${header.response}" />
							<to uri="jms:queue:{{AmqEnv}}.{{messagingErrorQueue}}" />
							<log message="notification sent to error queue" />
						</camel:when>
						<camel:otherwise>
							<log message=" Coming Otherwise section" />
							<log message="notification sent" />
						</camel:otherwise>
				  </choice>
				</when>
				<otherwise>
					<log message="Application APNS not added to camel context in price
drop" />
				</otherwise>
			</choice>
		</route>




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-tp5790088.html
Sent from the Camel Development mailing list archive at Nabble.com.

Mime
View raw message