You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Zala Goupil (JIRA)" <ji...@apache.org> on 2012/11/22 23:08:58 UTC
[jira] [Created] (WICKET-4879) Implementing channels in
wicket-atmosphere
Zala Goupil created WICKET-4879:
-----------------------------------
Summary: Implementing channels in wicket-atmosphere
Key: WICKET-4879
URL: https://issues.apache.org/jira/browse/WICKET-4879
Project: Wicket
Issue Type: New Feature
Components: wicket-atmosphere
Affects Versions: 6.3.0
Environment: Tomcat / Jetty
Reporter: Zala Goupil
Assignee: Emond Papegaaij
Good evening,
Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
I'm looking forward to hear from you.
Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "vineet semwal (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13503427#comment-13503427 ]
vineet semwal commented on WICKET-4879:
---------------------------------------
afaik what wicket-atmosphere does is it filters the overall subscribers based on if their corresponding predicate returns true or not when event is posted ,if a predicate of subscriber returns true then the method/subscriber gets invoked else not so in above case with "SomePredicate" if client A has sent response then predicate returns true only if A is receiver and hence only A gets response.
i can't reproduce your exception...
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "Zala Goupil (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13503278#comment-13503278 ]
Zala Goupil commented on WICKET-4879:
-------------------------------------
Not really, because if you post on the event bus with two clients registered, if I understand things correctly, the predicate which returns true sends the response to both clients, even if the other one returns false.
Let me explain a little more what is the current behaviour. Let's say that two clients A & B have the right @Subscribe method. Let's say that you send an event e to the event bus for that method. Then A processes e and sends the same response to both A & B. Then B processes the same event and sends a response to both A & B, too. So we have two responses received by both A & B. I have an app where it's visually obvious: I send a small notification in my @Subscribe method. The notification displays two times in each browser A & B. Which is what make me think it works like that. Plus, it looks consistent with what I know from Atmosphere's Meteor API (which is called under the hood). Hence the request for a Broadcaster-based solution.
If I use a predicate which returns true for A and false for B, here is what apparently occurs: A sends its response to both A & B since the predicate returns true. And B doesn't send anything since the predicate returns false. But the * same * response returns to both A & B since it comes from A.
What I would like to be able to do is to have a response computed by B's AtmosphereBehavior instance sent to B and a response computed by A's AtmosphereBehavior instance sent to A. Because those 2 responses can potentially be a little bit different from each other.
Does it make sense? Am I doing assumptions that I should not?
One more thing. Quoting wicket-atmosphere's JavaDoc: "The filter cannot rely on any context. For example, the RequestCycle may not be available". This seems to me a little bit limited. I fully understand why this is like this for the predicate. But if we have a way to dispatch the right event to the right @Subscribe method (or a channel implementation of any sort), maybe we will be able to filter things with more context, so that would be potentially easier.
OK, any thoughts about that?
Kind regards,
Pierre
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "Emond Papegaaij (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13504093#comment-13504093 ]
Emond Papegaaij commented on WICKET-4879:
-----------------------------------------
I don't see how you could return true for one client and false for another (other than using something like random). filter() is used with no receiver context at all. It is meant to be used to filter certain types of events (other than the actual instance type). For example, if you have an event that contains progress of a job and you only want your component to receive the events if the progress is 80% or higher, that's when you use filter(). The same filter should always return true for the same events.
Can you take a look at commit a5421ec488020a3835d49962e1f772dc1435e230? I've added methods to post an event to a single resource, either with a resource instance or via its uuid (which I think makes more sense). You can get the UUID with AtmosphereResource.getUUID(page).
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Fix For: 6.4.0
>
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "vineet semwal (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13503240#comment-13503240 ]
vineet semwal commented on WICKET-4879:
---------------------------------------
doesn't adding custom predicate in @Subscribe solves the problem?
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "vineet semwal (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13503397#comment-13503397 ]
vineet semwal edited comment on WICKET-4879 at 11/24/12 4:25 PM:
-----------------------------------------------------------------
see code below,i mean something like this,you can change/improve according to your usecase
public class InputWrapper<T> {
/**
*
* @param input
* @param id id is sessionid of sender
*/
public InputWrapper(T input, String id){
this.input=input;
this.sender=id;
}
public T getInput() {
return input;
}
public String getSender() {
return sender;
}
T input;
String sender;
}
/**
* compare sessionid and return true if session id of sender is same as receiver
*/
public class SomePredicate implements Predicate<InputWrapper>{
@Override
public boolean apply(@Nullable InputWrapper wrapper) {
return wrapper.getSender().equals(Session.get().getId());
}
}
was (Author: vineetsemwal):
see code below,i mean something like this,you can change/improve according to your usecase
public class InputWrapper<T> {
/**
*
* @param input
* @param id id is sessionid of sender
*/
public InputWrapper(T input, String id){
this.input=input;
this.sender=id;
}
public T getInput() {
return input;
}
public String getSender() {
return sender;
}
T input;
String sender;
}
/**
* compare sessionid and return true if session id of sender is same as receiver
*/
public static class SomePredicate implements Predicate<InputWrapper>{
@Override
public boolean apply(@Nullable InputWrapper wrapper) {
return wrapper.getSender().equals(Session.get().getId());
}
}
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "Zala Goupil (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13503505#comment-13503505 ]
Zala Goupil commented on WICKET-4879:
-------------------------------------
Unfortunately, my experience is that if a predicate matches for a client and doesn't matches for the others, the matching predicate sends the response to all clients. So in our case the message is sent only once, and not as many times as there are connected clients, but to all the connected clients. Which I find pretty annoying.
Regarding my exception, it only happens when using complex HTML, in one of my projects, it is totally absent. But in another one, it happens on a regular basis.
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "Emond Papegaaij (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13504401#comment-13504401 ]
Emond Papegaaij commented on WICKET-4879:
-----------------------------------------
Do you think you can make a quickstart for that? If so, please create a new ticket. However, I suspect the problem lies somewhere else, because the code in EventBus does not write anything to the other resources.
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Fix For: 6.4.0
>
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "Zala Goupil (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13504218#comment-13504218 ]
Zala Goupil commented on WICKET-4879:
-------------------------------------
Thanks again! I've tried this new code, but unfortunately the situation is the same: all the connected resources are refreshed when issuing: Application.get().getEventBus().post(MyObject, pageUuid), not just the one that I'm expecting.
Sorry about that, I don't know what could be wrong.
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Fix For: 6.4.0
>
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "Zala Goupil (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zala Goupil updated WICKET-4879:
--------------------------------
Attachment: wicket-atmosphere-quickstart.zip
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "Zala Goupil (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13503398#comment-13503398 ]
Zala Goupil edited comment on WICKET-4879 at 11/24/12 4:34 PM:
---------------------------------------------------------------
Yes, that's totally it! But unfortunately, my arguments below still apply.
Plus, it gives me strange exceptions to use this kind of things: UnknwonBehaviorIdException, NullPointerException because the appended component can't be found, etc. I tried using this kind of code but was forced to strip it because of these exceptions.
was (Author: zala):
Yes, that's totally it! But unfortunately, my arguments below still apply.
Plus, it gives me strange exceptiosn to use this kind of things: UnknwonBehaviorIdException, NullPointerException because the appended component can't be found, etc. I tried using this kind of code but was forced to strip it because of these exceptions.
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "Emond Papegaaij (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13503634#comment-13503634 ]
Emond Papegaaij commented on WICKET-4879:
-----------------------------------------
I agree that the filter construction is a bit weak. It can only be used to filter on properties of the event itself, not on properties of the receiver. The reason for this is that it is expensive to setup the entire context, such as the session and a request cycle. I think it should be possible to add a second filter that runs inside the AtmosphereRequestHandler, at which point the session, request cylcle and even the page are available.
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "Zala Goupil (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13503174#comment-13503174 ]
Zala Goupil commented on WICKET-4879:
-------------------------------------
I've attached a quickstart demonstrating the fact that when posting to the event bus, all clients registered to that resource receive the message. But, it is visually obvious in this example that it is not desired behaviour.
FYI, it's based on Emond's own quickstart.
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "Emond Papegaaij (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Emond Papegaaij resolved WICKET-4879.
-------------------------------------
Resolution: Fixed
Fix Version/s: 6.4.0
I've just pushed the implementation of a context aware filter. I've also updated the example to show how this works. Be advised though that filtering within the context of a Wicket request cyle is expensive. If you can implement the desired behavior via the Atmosphere API, I suggest you do so, because that should be much less expensive.
Wrapping the Atmosphere api is not what Wicket-Atmosphere is for, it is a bridge not a wrapper.
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Fix For: 6.4.0
>
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "vineet semwal (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13503397#comment-13503397 ]
vineet semwal commented on WICKET-4879:
---------------------------------------
see code below,i mean something like this,you can change/improve according to your usecase
public class InputWrapper<T> {
/**
*
* @param input
* @param id id is sessionid of sender
*/
public InputWrapper(T input, String id){
this.input=input;
this.sender=id;
}
public T getInput() {
return input;
}
public String getSender() {
return sender;
}
T input;
String sender;
}
/**
* compare sessionid and return true if session id of sender is same as receiver
*/
public static class SomePredicate implements Predicate<InputWrapper>{
@Override
public boolean apply(@Nullable InputWrapper wrapper) {
return wrapper.getSender().equals(Session.get().getId());
}
}
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "Zala Goupil (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13503398#comment-13503398 ]
Zala Goupil commented on WICKET-4879:
-------------------------------------
Yes, that's totally it! But unfortunately, my arguments below still apply.
Plus, it gives me strange exceptiosn to use this kind of things: UnknwonBehaviorIdException, NullPointerException because the appended component can't be found, etc. I tried using this kind of code but was forced to strip it because of these exceptions.
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4879) Implementing channels in
wicket-atmosphere
Posted by "Zala Goupil (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13503977#comment-13503977 ]
Zala Goupil commented on WICKET-4879:
-------------------------------------
Good evening,
I've just tried it. The behaviour is the same: if three clients are connected and that only one's filter returns true, then the same message goes to all the three clients. If two of them return true, then those two send the message to the three clients, and so on.
Personally, I'd like to be able to have the message sent by one client broadcasted to only this client. Of course, the use case of "one client sends to all" is useful, I just wish it was not the only one possible.
Anyway, your "contextAwareFilter" is useful, thanks for that !
I've tried myself to implement a Broadcaster-based message-sending in your code, but for the moment, I failed. Too bad. The one thing I miss is how to provide an AtmosphereResource to my Broadcaster.
Anyway, keep up the good work! :-)
> Implementing channels in wicket-atmosphere
> ------------------------------------------
>
> Key: WICKET-4879
> URL: https://issues.apache.org/jira/browse/WICKET-4879
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-atmosphere
> Affects Versions: 6.3.0
> Environment: Tomcat / Jetty
> Reporter: Zala Goupil
> Assignee: Emond Papegaaij
> Fix For: 6.4.0
>
> Attachments: wicket-atmosphere-quickstart.zip
>
>
> Good evening,
> Now that both Tomcat & Jetty support native WebSockets, it would be a killer-feature to implement Comet / WebSockets channels. i.e. being able to have a channel id and to post a message to one client only or to all the clients who subscribed to a certain channel.
> For the moment, it is possible to do it, but to the (expensive) price of having a PerRequestBroadcastFilter and tweaking it if we manage to do it. But it would be great to have a link to the Broadcaster API from Atmosphere, which I think, supports this kind of things.That would probably be way more efficient than PerRequestBroadcastFilter tweaking.
> As of today, when posting a message to the event bus, all pages who have the @Subscribed-decorated method suitable to process this message will do it, which is not always desirable.
> I'm looking forward to hear from you.
> Regards
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira