This project implements a Google Cloud Messaging component for Apache Camel.
from("direct:foo").to("gcm:/topics/bar?apiKey=AIz...");
apiKey
collapseKey
timeToLive
- defaults to3
delayWhileIdle
restrictedPackageName
dryRun
retries
- defaults to0
(no retries)stringBodyDataKey
- data key for string message bodies, defaults tomessage
to
- recipient of the message, optional. If absent, defaults to the name of the endpoint (/topics/bar
forgcm:/topics/bar?apiKey=AIz...
).
- If message body is a string, it will be sent in the
data
as<stringBodyDataKey>:<body>
. - Otherwise message body will be interpreted as a map and sent in the
data
as key-value pair, with both keys and values converted to strings.
Body "myMessage"
will be sent as:
{
"data" : {
"message" : "myMessage"
}
}
The following body:
final Map<String, String> body = new HashMap<String, String>();
body.put("facilityEquipmentnumber", "10213788");
body.put("stationName", "Arnstadt Hbf");
body.put("facilityDescription", "Aufzug zu Bstg 2/3");
body.put("facilityState", "INACTIVE");
Will be sent as:
{
"data" : {
"facilityEquipmentnumber" : "10213788",
"stationName" : "Arnstadt",
"facilityDescription" : "Aufzug zu Bstg 2/3",
"facilityState" : "INACTIVE"
}
}