[aerogear-dev] Java Sender API - fire&forget - adding callback methods?

Sebastien Blanc scm.blanc at gmail.com
Thu Oct 17 08:22:41 EDT 2013


On Thu, Oct 17, 2013 at 2:19 PM, Matthias Wessendorf <matzew at apache.org>wrote:

>
>
>
> On Thu, Oct 17, 2013 at 1:21 PM, Sebastien Blanc <scm.blanc at gmail.com>wrote:
>
>> So I started to look more closely to this, and I'm wondering how we want
>> the Callback to be. I see 2 options that are described here :
>> https://gist.github.com/sebastienblanc/7023151
>>
>> Basically, version 1 has a 'completed' method which will be invoked no
>> matter which http status code is returned, the developer has than to
>> implement it's own logic of handling the status. The 'failure' method will
>> be invoked  in case of an exception is thrown (IOException for instance)
>>
>
> Similar to what the JAX-RS 2.0 client lib does:
> https://jersey.java.net/documentation/latest/async.html#d0e7394
>
> Will this 'dramatically' change our call as well (e.g. async nature?)
>

Nope, both options have no big impact.
But speaking of that, I plan to keep the old merthod send(UnifiedMessage
message), the dev can choose just a fire&forget or with callback ? wdyt ?


>
> -M
>
>
>
>>
>> Version 2 has a 'onSuccess' method which handles the 2xx response codes
>> and a 'onError' which handles 4xx, 5xx codes or even if an exception
>> has occurred.
>>
>> Do you have any preference or even an alternative solution ?
>>
>> Seb
>>
>>
>>
>>
>>
>>
>> On Tue, Oct 8, 2013 at 3:14 PM, Sebastien Blanc <scm.blanc at gmail.com>wrote:
>>
>>> FYI Karel has created a Jira for this
>>> https://issues.jboss.org/browse/AGPUSH-373
>>>
>>>
>>>
>>> On Tue, Sep 24, 2013 at 11:43 AM, Karel Piwko <kpiwko at redhat.com> wrote:
>>>
>>>> On Thu, 19 Sep 2013 10:13:52 -0400
>>>> Summers Pittman <supittma at redhat.com> wrote:
>>>>
>>>> > On 09/18/2013 09:37 AM, Karel Piwko wrote:
>>>> > > On Wed, 18 Sep 2013 09:31:36 -0400
>>>> > > Summers Pittman <supittma at redhat.com> wrote:
>>>> > >
>>>> > >> On 09/17/2013 11:17 AM, Karel Piwko wrote:
>>>> > >>> Hi,
>>>> > >>>
>>>> > >>> I went once again through
>>>> > >>>
>>>> http://lists.jboss.org/pipermail/aerogear-dev/2013-June/002901.html -
>>>> > >>> which says that Sender API should be fire&forget. It feels more
>>>> like
>>>> > >>> "maybe fire"&forget, for instance it does not say that your
>>>> credentials
>>>> > >>> were wrong
>>>> > >>> - or it says, you need parse logs to get that information.
>>>> > >>>
>>>> > >>> If I think about Android, iOS, JS solutions to communicate with
>>>> > >>> UnifiedPush we provide - Pipes - they always provide a callback
>>>> to be
>>>> > >>> executed on success/failure. Could we add callback to Sender API?
>>>> Or
>>>> > >>> should not Aerogear rather have something like Pipes abstraction
>>>> for Java
>>>> > >>> developers instead of pretty dumb Sender API?
>>>> > >>>
>>>> > >>> Thoughts?
>>>> > >> In a bit of crazy land perhaps the client could keep a web socket
>>>> or BSD
>>>> > >> Socket open to the server which would let it get callbacks about
>>>> things
>>>> > >> that happen further down the tree.
>>>> > > Isn't this land called vert.x?
>>>> > Maybe I misunderstood.  I thought it was wanting to get information
>>>> from
>>>> > the push server about the status of messages being sent not the
>>>> response
>>>> > of the commands to the push server itself.
>>>>
>>>> I was speaking about the latter.
>>>>
>>>> > >
>>>> > >>> Thanks,
>>>> > >>>
>>>> > >>> Karel
>>>> > >>> _______________________________________________
>>>> > >>> aerogear-dev mailing list
>>>> > >>> aerogear-dev at lists.jboss.org
>>>> > >>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>>> > >> _______________________________________________
>>>> > >> aerogear-dev mailing list
>>>> > >> aerogear-dev at lists.jboss.org
>>>> > >> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>>> > > _______________________________________________
>>>> > > aerogear-dev mailing list
>>>> > > aerogear-dev at lists.jboss.org
>>>> > > https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>>> >
>>>> > _______________________________________________
>>>> > aerogear-dev mailing list
>>>> > aerogear-dev at lists.jboss.org
>>>> > https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>>>
>>>> _______________________________________________
>>>> aerogear-dev mailing list
>>>> aerogear-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>>>
>>>
>>>
>>
>> _______________________________________________
>> aerogear-dev mailing list
>> aerogear-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
>
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20131017/2bace193/attachment-0001.html 


More information about the aerogear-dev mailing list