This post has NOT been accepted by the mailing list yet.
I have some requirement for Live chat for my company Website.
My main requirement is,
There are 5 agents in my office which responds to answer customer queries.
At a time many Customer can ask questions, Say Customer A ask Question, In that case I have to check which Agent is Free and dedicate 1 Free Agent to that(A) Customer.
Similarly for all the other Customers dedicated agent should be allocated and once all the agent is busy then further Customer Request should be Queued.
After completing customer Queries, Agent should be Free to handle Queued Customer.
I came to know that Atmosphere Framework provide such functionality easily and gave my hands on Atmosphere (atmosphere-jquery-pubsub-1.0.18.war).
I am able to run a program but it is acting as Group Chat i.e If written "Hi", then it get Broadcasted to all the Browsers connected instead I need as Agent-Customer case i.e One to One dedicated communication.
public class JQueryPubSub
private Broadcaster topic;
public SuspendResponse<String> subscribe()
return new SuspendResponse.SuspendResponseBuilder().broadcaster(this.topic).outputComments(true).addListener(new EventsLogger()).build();
public Broadcastable publish(@FormParam("message") String message)
return new Broadcastable(message, "", this.topic);
What I tried to achieve same functionality is,
I took 1 HashTable, in which I add AtmosphereResource based on Filtered IP then I tried to assign Customer to Admin present in HashTable.
I also tried to do topic.setID() and kept ID same for 2 browsers dynamically then it says
[Atmosphere-Shared-DispatchOp-0] DEBUG o.atmosphere.cpr.DefaultBroadcaster - Invoking BroadcastFilter with dummy AtmosphereResource -1