Skip to content

highsource/camel-google-cloud-messaging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Camel Google Cloud Messaging

This project implements a Google Cloud Messaging component for Apache Camel.

Usage

from("direct:foo").to("gcm:/topics/bar?apiKey=AIz...");

Configuration

  • apiKey
  • collapseKey
  • timeToLive - defaults to 3
  • delayWhileIdle
  • restrictedPackageName
  • dryRun
  • retries - defaults to 0 (no retries)
  • stringBodyDataKey - data key for string message bodies, defaults to message

Supported headers

  • to - recipient of the message, optional. If absent, defaults to the name of the endpoint (/topics/bar for gcm:/topics/bar?apiKey=AIz...).

Supported body types

  • 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 examples

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"
  }
}