bayeux4netty suggestions

Dai Jun guiwuu at gmail.com
Wed Sep 2 03:41:57 EDT 2009


Hi Bob and Trustin,

Sorry for my late response. And thanks for your suggestions.

On Wed, Sep 2, 2009 at 8:02 AM, 이희승<trustin at gmail.com> wrote:
> On Wed, 2 Sep 2009 07:09:11 +0900 (KST)
> Bob McWhirter <bmcwhirt at redhat.com> wrote:
>> Hiya Dai and folks--
>>
>> So, I've gotten bayeux4netty codec happy with
>> dojo-cometd-javascript, but I had to patch cometd.js.  Maybe I'm just
>> doing it wrong.

I am also using cometd.js in the two examples, but don't patch it. It
works very well to me. Maybe it's about the version of Dojo. I am
using latest release one, Dojo Toolkit 1.3.2: Dojo + Dijit + DojoX.

>>
>> Anyhow, it seems that if a client just goes away, and doesn't
>> disconnect cleanly, the BayeuxRouter hangs onto its BayeuxConnection
>> indefinitely.  Should these timeout-if-idle, like HTTP sessions?

Yes, I plan to implement timeout in next update. I've post the plan
proposal another thread[0]. We can still discuss with it.

>>
>> Also, it seems awkward to use router.onPublish( publishRequest ) to
>> pump data down the pipe.
>>
>> I'd ultimately like a router.send(PublishRequest r) or
>> router.send(BayeuxData m), plus a List<X> form of those.
>
> Would PublishRequest... and BayeuxData... (varargs) also be useful?
>
>> I anticipate needing to batch, instead of the single send/flush that
>> occurs with onPublish().  I'd be using this API from another source
>> (such as perhaps a JMS->Bayeux bridge).

Good idea. It's a urgent requirement. I will put in to the month's
plan with high priority.

>>
>> I'd also like to not rely on the singleton
>> BayeuxRouter.getInstance(), but other code seems to assume that's how
>> we get it.  I'd like to be able to inject a router to be used by
>> BayeuxDecoder and BayeuxConnection.
>>
>> We could instead inject a BayeuxRouter instance into BayeuxDecoder,
>> which passes it along to BayeuxConnection.  All avoiding
>> getInstance()'s singleton, and allowing for multi-application
>> isolation.
>
> +1

+1, too. I was thinking about this problem recently. The current
singleton model is not enough in real server cases. With injection, we
can manage router in AS. But I am not familiar with injection. I have
to postpone it to next next update. If you or anybody else know about
it, we can speed it up. I'd love to discuss with it in another new
thread.

>
>> I'd also like to see BayeuxRouter be an interface I could implement
>> myself.  If running a cluster of servers, we need a router that can
>> talk to other routers, not just BayeuxConnections.  Clients talking
>> to ServerA would need their stuff pushed to clients connected to
>> ServerB in the same cluster.
>
> +1

Sure. But I am afraid it's somewhat business of AS. I think the codec
should be simple and concentrated. The advanced management should
depend on user's application environment. Or we could provide a
mechanism to extend BayeuxRouter for integrating with uses' current
environment. What do you think about it? We could discuss it deep in
another thread.

>
> Another thing Bob and I discussed about naming was receiveToQueue() and
> sendToQueue() in BayeuxConnection.  Perhaps they could be renamed to
> something more comprehensive, like offerUpstreamEvent() and
> offerDownstreamEvent() for example.  I guess we need some
> brainstorming, Bob and Danny?

Sounds cool!  discussed names with Luís M. Costa before. Now, these
names are really very hard to understand. IMHO, the word "Event" may
imply that methods return event objects, like BayeuxRequestEvent. But
the queues only contain and return Bayeux message entities, which is
not like events.  So, I have a simple rename proposal in below:
        receiveToQueue -> putToUpstreamQueue
        sendToQueue    -> putToDownstreamQueue
        pollFromUpsream -> getFromUpstreamQueue

What's your opinions? I think they are a little long and redundant.:)
I am looking for your ideas.

>
> --
> Trustin Lee, http://gleamynode.net/
> _______________________________________________
> netty-dev mailing list
> netty-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-dev
>


Best regards,

Dai Jun or Danny Dai(in English) - http://guiwuu.googlepages.com
GTalk: guiwuu at gmail.com | QQ: 93409048 | MSN: guiwuu at hotmail.com |
Twitter: @guiwuu

Jonathan Swift  - "May you live every day of your life." -
http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html



More information about the netty-dev mailing list