JBoss.orgCommunity Documentation

Chapter 46. AeroGear Integration

46.1. Configuring an AeroGear Connector Service
46.2. How to send a message for AeroGear

AeroGears push technology provides support for different push notification technologies like Google Cloud Messaging, Apple's APNs or Mozilla's SimplePush. HornetQ allows you to configure a Connector Service that will consume messages from a queue and forward them to an AeroGear push server and subsequently sent as notifications to mobile devices.

AeroGear Connector services are configured in the connector-services configuration:

    <connector-service name="aerogear-connector">
    <factory-class>org.hornetq.integration.aerogear.AeroGearConnectorServiceFactory</factory-class>
    <param key="endpoint" value="endpoint"/>
    <param key="queue" value="jms.queue.aerogearQueue"/>
    <param key="application-id" value="an applicationid"/>
    <param key="master-secret" value="a mastersecret"/>
    </connector-service>
    <address-setting match="jms.queue.lastValueQueue">
    <last-value-queue>true</last-value-queue>
    </address-setting>
    

Shown are the required params for the connector service and are:

As well as these required paramaters there are the following optional parameters

More in depth explanations of the AeroGear related parameters can be found in the AeroGear Push docs

To send a message intended for AeroGear simply send a JMS Message and set the appropriate headers, like so

    Message message = session.createMessage();

    message.setStringProperty("AEROGEAR_ALERT", "Hello this is a notification from HornetQ");

    producer.send(message);
        

The 'AEROGEAR_ALERT' property will be the alert sent to the mobile device.

Its also possible to override any of the other AeroGear parameters by simply setting them on the message, for instance if you wanted to set ttl of a message you would:

    message.setIntProperty("AEROGEAR_TTL", 1234);
        

or if you wanted to set the list of variants you would use:

    message.setStringProperty("AEROGEAR_VARIANTS", "variant1,variant2,variant3");
        

Again refer to the AeroGear documentation for a more in depth view on how to use these settings