Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 6. APNS
Apns Component 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Available as of Camel 2.8
The apns component is used for sending notifications to iOS devices. The apns components use javapns library. The component supports sending notifications to Apple Push Notification Servers (APNS) and consuming feedback from the servers.
The consumer is configured with a default polling time of 3600 seconds. It is advisable to consume the feedback stream from Apple Push Notification Servers regularly at larger intervals to avoid flooding the servers.
The feedback stream gives information about inactive devices. This information can be consumed infrequently (every two or three hours) if your mobile application is not heavily used.
Maven users will need to add the following dependency to their
pom.xml
for this component:
URI format 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
To send notifications:
apns:notify[?options]
apns:notify[?options]
To consume feedback:
apns:consumer[?options]
apns:consumer[?options]
Options 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Producer 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Property | Default | Description |
---|---|---|
tokens
|
Empty by default. Configure this property in case you want to statically declare tokens related to devices you want to notify. Tokens are separated by comma. |
Consumer 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Property | Default | Description |
---|---|---|
delay
|
3600
|
Delay in seconds between each poll. |
initialDelay
|
10
|
Seconds before polling starts. |
timeUnit
|
SECONDS
|
Time Unit for polling. |
userFixedDelay
|
true
|
If true , use fixed delay between pools, otherwise fixed rate is used. See ScheduledExecutorService in JDK for details.
|
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. For further information, see the test source code.
Exchange data format 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
When Camel fetches feedback data corresponding to inactive devices, it retrieves a List of InactiveDevice objects. Each InactiveDevice object on the retrieved list will be set as the In body, and then processed by the consumer endpoint.
Message Headers 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Camel Apns uses these headers.
Property | Default | Description |
---|---|---|
CamelApnsTokens
|
Empty by default. | |
CamelApnsMessageType
|
STRING, PAYLOAD
|
If you choose PAYLOAD as the message type, the message will be considered an APNS payload and sent as is. If you choose STRING, the message will be converted to an APNS payload |
ApnsServiceFactory Builder Callback 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
ApnsServiceFactory
comes with an empty callback method that can be used to configure or replace the default ApnsServiceBuilder
instance. The method has the following format:
protected ApnsServiceBuilder configureServiceBuilder(ApnsServiceBuilder serviceBuilder);
protected ApnsServiceBuilder configureServiceBuilder(ApnsServiceBuilder serviceBuilder);
Samples 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Camel Xml route 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Camel Java route 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Create camel context and declare apns component programmatically 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
ApnsProducer - iOS target device dynamically configured via header: "CamelApnsTokens" 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
ApnsProducer - iOS target device statically configured via uri 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
ApnsConsumer 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
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");
See Also 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!