protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
ApnsServiceFactory apnsServiceFactory = new ApnsServiceFactory();
apnsServiceFactory.setCertificatePath("classpath:/certificate.p12");
apnsServiceFactory.setCertificatePassword("MyCertPassword");
ApnsService apnsService = apnsServiceFactory.getApnsService(camelContext);
ApnsComponent apnsComponent = new ApnsComponent(apnsService);
camelContext.addComponent("apns", apnsComponent);
return camelContext;
}
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
ApnsServiceFactory apnsServiceFactory = new ApnsServiceFactory();
apnsServiceFactory.setCertificatePath("classpath:/certificate.p12");
apnsServiceFactory.setCertificatePassword("MyCertPassword");
ApnsService apnsService = apnsServiceFactory.getApnsService(camelContext);
ApnsComponent apnsComponent = new ApnsComponent(apnsService);
camelContext.addComponent("apns", apnsComponent);
return camelContext;
}
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
[[APNS-ApnsProducer-iOStargetdevicedynamicallyconfiguredviaheader:"CamelApnsTokens"]] ApnsProducer - iOS 目标设备通过标头 "CamelApnsTokens"
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
from("direct:test")
.setHeader(ApnsConstants.HEADER_TOKENS, constant(IOS_DEVICE_TOKEN))
.to("apns:notify");
}
}
}
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
from("direct:test")
.setHeader(ApnsConstants.HEADER_TOKENS, constant(IOS_DEVICE_TOKEN))
.to("apns:notify");
}
}
}
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
from("direct:test").
to("apns:notify?tokens=" + IOS_DEVICE_TOKEN);
}
};
}
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
from("direct:test").
to("apns:notify?tokens=" + IOS_DEVICE_TOKEN);
}
};
}
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
from("apns:consumer?initialDelay=10&delay=3600&timeUnit=SECONDS")
.to("log:com.apache.camel.component.apns?showAll=true&multiline=true")
.to("mock:result");
from("apns:consumer?initialDelay=10&delay=3600&timeUnit=SECONDS")
.to("log:com.apache.camel.component.apns?showAll=true&multiline=true")
.to("mock:result");
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow