Here is the Javascript I am using to subscribe and publish where ws is the ColdFusion WebSocket object created with the cfwebsocket tag:
ws.subscribe("messaging.friends", {userid: $('#userid').val(), selector: "targetuser eq '"+userselector+"'"}, friendsCallback);
...
ws.publish("messaging.friends", $("#message").val(), {targetuser: $('#userid').val()});
The simple code above subscribes to the messaging.friends subchannel using a selector that jQuery grabs from a web form. The second line of code published a message to that channel with the same targetuser to match the selection criteria.When I tested filtering I found that all of my messages were being delivered regardless of filtering criteria. I had read previously that if your channel listener CFC implemented the canSendMessage() method, that this would occur. I had removed the offending function but all of my messages continued to arrive regardless of selector criteria.
After much frustration I restarted ColdFusion and everything started working. What seems to have happened is that when CF the Java creates classes from your CFC it picks up on changes within a method, but does not pick up that a method has been removed until the server is restarted (or if the application ends would be my guess). Hope this saves someone some time.