I've just implemented a lightweight java client for receiving push messages
from AeroGear WebPush Server . It is easy to use and fully async!
A few words about decision to use Jetty as a HTTP/2 client:
Currently there are only 3 Java libraries, which implement client side of
HTTP/2 protocol : Netty, Jetty and OkHttp. I tried all of them:
- First of all I tried to use OkHttp. This is a lightweight http client
for Android and other Java apps. But currently this library supports HTTP/2
protocol only via old HTTP/1.1 API. It works well for simple
request-response, but its client API does not allow to use HTTP/2 features,
like Server Push Frames. I looked at GRPC , because Googlers use OkHttp
for HTTP/2 transport. But they don't use public API, they use only inner
classes to handle frames and built their own logic atop this classes. It
would be too complicated for our purposes.
- Secondary, I tried to refactor our WebPush console to a client
library. But this way is complicated too. netty-codec-http2 does not
provide a client API, it is only codec, low level protocol implementation.
- Now I use jetty-http2-client. It is easy to configure and use, fast
and async. Jetty provides a user friendly API to handle HTTP/2 streams and
get PUSH_PROMISE frames.
For more information, look at my commit history.
In the future, if there will be more lightweight alternatives than Jetty
(for example, new version of OkHttp or Java 9 API), I will rewrite the
transport layer of my library.
Here is an example, how to use my library .
Twitter: @idelpivnitskiy <https://twitter.com/idelpivnitskiy>
GitHub: @idelpivnitskiy <https://github.com/idelpivnitskiy>
So I've got a few ideas for how to implement this, but I hope some people
more experienced with the platform can give some feedback before.
In UPS right now we have a concept of categories. A single UPS message can
be broadcast to a bunch of devices which are subscribed to this category.
Google now supports this for GCM on Chrome, iOS, and Android so UPS can
send a single message to GCM and GCM will broadcast that to up to a million
End Quick Background
So first, how do we switch between sending a message to each device in a
category to sending a topic message to GCM?
In TokenLoader.java#L113 we are using the clientInstallationService to
build a string of deviceTokens based on the variant and message criteria.
Is there any reason we can't create a "topicToken" which will be recognized
later by GCMPushNotificationSender? Another benefit to making this change
here is that if we have over a million subscribers to the category we can
just default to the default messaging.
There is also an open issue of whether or not we will update the clients to
filter based on what category a message was sent to. To do this we will
have to include the category information in the message when we send it to
devices going forward. In GCM a topic message includes this information.
This means that if we have over a million subscriptions in the topic we
will need to fall back to using the category information anyway.
Continuing on from the thread of falling back, it is possible for a topic
message to fail to send because there are too many subscribers. How would
UPS handle regenerating the messages as deviceToken instead of topicToken
Of course if someone has a better idea than "topicTokens" I'm all ears.
I don't really know if this is the right email address for asking question but I give it a try, please redirect me if I'm wrong !
------ Problem in the UnifiedPush Server User Guide ------
Before explaining my problem I want to tell you that something isn't clear enough from my point of view in your migration guide (https://aerogear.org/docs/unifiedpush/ups_userguide/index/#migration-guide).
On the part where you explain the database migration for mysql you write :
Inside of the extracted zip file, there is a liquibase-mysql-example.properties, copy that to liquibase.properties.
cp liquibase-mysql-example.properties liquibase.properties
Once done, you need to edit the new file to match your database name and credentials.
The problem with this is that you can't choose the version you want to upgrade to.
Since I have "changeLogFile=liquibase/master.xml" in my liquidbase.properties, the only upgrade I was able to make was to the 1.0.0-Final and I'm on the 1.0.2.
I had to open the ups-migrator.jar (wich wasn't really userfriendly) to see what was my option. And then I was able to go the version I want (exemple -> "changeLogFile=liquibase/1.1.0-Final/releasechanges.xml")
To conclude I think that just a small explanation in the migration guide will make everything more clear.
------ My migration problem ------
I'm currently using AerogearPush Server 1.0.2 and I want to go to the 1.1.0-Final version.
I download the last package (1.1.0-Final) on this page https://aerogear.org/getstarted/downloads
Like explain above I had some trouble make it work to move to the version I wanted.
Right now in 1.0.2 I can use the Migrator Tool to make sure that my 1.0.2 Mysql database is good and to upgrade it to 1.0.3.
But I can't go the 1.1.0-Final, I join to this email the error I get from the Migrator Tool.
Can you please tell me where the problem might come from or if you have any solution ?
Hi, trying to install the docker aerogear-wildfly latest version. In the
log, I've got " Unexpected problem gathering statistics:
java.lang.IllegalStateException: JBAS011477: Persistence unit
'ag-push.war#unifiedpush-default' is not available".
Seen on Mac OX (El Capitan) and Ubuntu 14.04.3 LTS
Has someone got any idea about this issue ?
View this message in context: http://aerogear-dev.1069024.n5.nabble.com/docker-aerogear-wildfly-Persist...
Sent from the aerogear-dev mailing list archive at Nabble.com.
I am using aerogear UPS on openshit, I wanted to know if Push
notification can be sent to specific device by its Device Token, if yes
then can you provide an demo code for the same. Thanks
I did some testing of JMS workflow used in UPS during sending
notifications. I can confirm, that suggested blocking strategy, as
protection against OOM errors, works as expected. However in worst scenario
could cause blocking 6 of 20 threads (from MDBs pool). So I would suggest
using different approach, with more optimal resource usage, some options
were discussed already with Lukas.
I noticed the "deviceType" field in UPS seems to be used inconsistently between Server and the SDKs, and is perhaps underspecified.
The docs only say this much:
* "deviceType: The device type of the device or the user agent."
- what does "device type of the device" mean? "Type" in what sense?
* "deviceType: A list of raw device types that should receive the message (e.g. Coupon only for iPad and AndroidTablets). The deviceType needs to be stored when the device is registering itself with the server."
- what's a "raw device type"?
- "needs to be stored" - who needs to do that? Store where?
When trying to use the Sender API, the obvious question is: what's the list of possible values? The docs don't answer that.
Another missing piece of information:
* Is the deviceType an arbitrary string set by the user during registration?
* Or, is it somehow automatically set by the client SDKs?
After a bit of digging through the SDKs and APIs, I can see this (not necessarily 100% correct):
* The Sender API accepts arbitrary values
* Android SDK - has deviceType in model, sets to "ANDROID" by default
* Windows SDK - doesn't even have deviceType in model
* iOS SDK - has deviceType in model, doesn't set to any default value
* Cordova Android - doesn't set, so uses "ANDROID"
* Cordova WP8 - not in model, not set
* Cordova iOS - sets UIDevice.model (I can't really read ObjC, just a guess by looking at the code)
Can we come up with clearer semantics for the deviceType field?
Technical Writer, FeedHenry