开发者

BlazeDS using subtopics set at server side with ajax-bridge

I'm doing research into BlazeDS , and i am trying to use the ajax-bridge to perform this trough javascript.

What i'm trying to do is send an asynchronous message from the server to the client(s)

On it's own, this work perfectly.

However , now i'm trying to use subtopics , to be able to limit the number of clients the message is sent to.

As i understand it , setting the subtopic at server side ,works by setting the header in AsynchMessage :

msg.setDestination("TestingDestination");
msg.setHeader("DSSubtopic", "siteData.subtopic1" );

And then setting the subtopic 开发者_如何转开发in the client :

consumer.setDestination("TestingDestination");
consumer.subtopic = "siteData.subtopic1" ;

However, this is not working correctly : I do not receive any message at the client side.


I found the reason it didn't work :

When using the ajax-bridge , you cannot use consumer.subtopic .

You need to use consumer.setSubtopic() :

consumer.setDestination("TestingDestination"); 
consumer.setSubtopic("siteData.subtopic1") ; 

Now it works correctly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜