Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created HazlecastInterceptor that posts the messages onto the same topic #178

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Darrelk
Copy link
Contributor

@Darrelk Darrelk commented Feb 24, 2015

Created HazlecastInterceptor that posts the messages onto the same topic on all server. Then after receiving the message from a different server, I follow the same route as I did when receiving a normal message. This will work better then the HazelcastBroadcaster when using MetaBroadcaster methods.

scenario 1: Using the MetaBroadcaster and HazelcastBroadcaster:
Architecture: Two Atmosphere servers with Hazelcast and a Load balancer.
Client 1 connected to server one. ("myConnections/client1")
Client 2 connected to server two using meta broadcaster to send to /* broadcasters. ("myConnections/broadcastAll")

metaBroadcaster.broadcastTo("myConnections/*", message);

  • If broadcasters does not exist on server two, then the message will never be added to the Hazelcast Topic and thus never be received by client 1 on server 1.

…pic on all server. Then after receiving the message from a different server, I follow the same route as I did when receiving a normal message. This will work better then the HazelcastBroadcaster when using MetaBroadcaster methods.
@buildhive
Copy link

Atmosphere Framework » atmosphere-extensions #725 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@jfarcand
Copy link
Member

@Darrelk Can you add some Javadoc explaining how to use it? Gigantic thanks!

@Darrelk
Copy link
Contributor Author

Darrelk commented Feb 27, 2015

Hello, still trying to figure out a way to make it more generic. without any code changes on the users side. Not 100% sure how atmosphere works when I broadcast a message using

broadcaster.broadcast(message)

Will this pass trough all the other interceptors, service annotated classes and filters? And will it pass trough the HazelcastInterceptor again publishing the same message back to the topic creating an infinite loop?

The way I am using it at the moment is by adding it as a custom Interceptor with my Business logic in the onMessage event of the hazelcast Topic. But to be able to really share this code I will have to make it so that it can just be added to web.xml and work... Will try and investigate a bit more on how I will accomplish that.

For now the only way to use this is by downloading the source and adding it to your project. And adding your custom code in the onMessage event of Hazelcast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants