MetaPublishHandler doesn't seems to deliver

0 views
Skip to first unread message

Tiziano Perrucci

unread,
Jun 13, 2009, 7:25:33 AM6/13/09
to Cometd Dev
Hi,
i've create a BayeuxService that is subscribed to /meta/handshake and /meta/subscribe, but the respective methods (listener) are not invoked
(i'm using jetty 6.1.18)

i've also explicitly added a MessageListener to the client (that the service are using) and doesn't work

looking around the implementation, the MetaPublishHandler check the policy and deliver the message througth the root channel
...
if(_securityPolicy.canPublish(client,channel_id,message))
            {
                _root.doDelivery(getChannelId(channel_id),client,message);
            }
...

i've checked that the security policy return true but i'm not able to find the reason of that behaviour

thanks in advance for your help
cheers
Tiziano

Greg Wilkins

unread,
Jun 21, 2009, 7:16:51 PM6/21/09
to comet...@googlegroups.com

Tiziano,

the MessageListener works for me. You need to add it to the Client that
you want to listen on.

Can you send a test case that fails and we can check it.

cheers

Tiziano Perrucci

unread,
Jun 22, 2009, 9:17:44 AM6/22/09
to comet...@googlegroups.com
Greg,
the MessageListener incapsulated in the BayeuxService doesn't receive the meta notifications

public class Test extends BayeuxService {
    private Logger log;

    public Test(Logger log, Bayeux bayeux) {
        super(bayeux, "Test");
        this.log = log;

        subscribe(Bayeux.META_HANDSHAKE, "testHandshake");
        subscribe(Bayeux.META_SUBSCRIBE, "testSubscribe");
    }

    public void testHandshake(Client client, Object data) {
        log.info("handshake client: " + client + ", data: " + data);
    }

    public void testSubscribe(Client client, Object data) {
        log.info("subscribe client: " + client + ", data: " + data);
    }
}

thaks for your time.

cheers
Tiziano

Tiziano Perrucci

unread,
Jul 8, 2009, 7:54:59 PM7/8/09
to cometd-dev
any help is appreciated
Tiziano

On Jun 22, 3:17 pm, Tiziano Perrucci <tiziano.perru...@gmail.com>
wrote:

Simone Bordet

unread,
Aug 3, 2009, 2:05:20 PM8/3/09
to comet...@googlegroups.com
Hi,

On Thu, Jul 9, 2009 at 01:54, Tiziano
Perrucci<tiziano....@gmail.com> wrote:
>
> any help is appreciated
> Tiziano
>
> On Jun 22, 3:17 pm, Tiziano Perrucci <tiziano.perru...@gmail.com>
> wrote:
>> Greg,
>> the MessageListener incapsulated in the BayeuxService doesn't receive the
>> meta notifications
>>
>> public class Test extends BayeuxService {
>>     private Logger log;
>>
>>     public Test(Logger log, Bayeux bayeux) {
>>         super(bayeux, "Test");
>>         this.log = log;
>>
>>         subscribe(Bayeux.META_HANDSHAKE, "testHandshake");
>>         subscribe(Bayeux.META_SUBSCRIBE, "testSubscribe");
>>     }
>>
>>     public void testHandshake(Client client, Object data) {
>>         log.info("handshake client: " + client + ", data: " + data);
>>     }
>>
>>     public void testSubscribe(Client client, Object data) {
>>         log.info("subscribe client: " + client + ", data: " + data);
>>     }
>>
>> }

I just tried what above, and works like a charm for me: all meta
channels are correctly notified upon the correspondent message.
FYI, there is now a test in the test suite that proves that.

Simon
--
http://bordet.blogspot.com
---
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless. Victoria Livschitz

Tiziano Perrucci

unread,
Aug 3, 2009, 2:36:53 PM8/3/09
to comet...@googlegroups.com
Hi Simon,
i've tried Jetty 6.1.19 and it works too (maybe the 6.1.18 version is bugged)

thanks for you time
Tiziano
Reply all
Reply to author
Forward
0 new messages