I have a chat application that is based on the p:poll component. I think it would be major improvement to refactor it to use p:push.
But the main issue is that this chat is made between two different webapps. webapp1 is used by the company clients and webapp2 is used by the company attendants. Each webapp has its own theme and authentication rules, so I don't pretend merging them in a single webapp.
Since the p:socket automatically appends the current context, is there a way to pass the full URL? The idea is to have the same channel in both webapps, but webapp1 would broadcast to webapp2 and vice versa.
Thanks in advance,
Phillip
[SOLVED] Push between multiple webapps?
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
Start by reading all of the following:
primefaces.PUSH_SERVER_URL with different urls
[solved] Problem with Apache 2 proxy
Push not working inside GF Virtual Server web app
Multiple push applications on one web server instance
also, Andy recommended some time ago that you may want to use a JMS server in a 'middle tier' that will accept requests from multiple webapps, and push to appropriate/connected clients.
after you implement this and meet your requirement, please share your implementation here. thanks.
primefaces.PUSH_SERVER_URL with different urls
[solved] Problem with Apache 2 proxy
Push not working inside GF Virtual Server web app
Multiple push applications on one web server instance
also, Andy recommended some time ago that you may want to use a JMS server in a 'middle tier' that will accept requests from multiple webapps, and push to appropriate/connected clients.
after you implement this and meet your requirement, please share your implementation here. thanks.
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
Thanks for the links, but from what I understood they refer to different issues.
JMS would be an option, but I never worked with it before, so I'd like to try something simpler before.
Since both webapps are on the same server, I think that if I could pass the context name to the push method it would work:
Is there a parameter to allow me to do this?
Thanks
JMS would be an option, but I never worked with it before, so I'd like to try something simpler before.
Since both webapps are on the same server, I think that if I could pass the context name to the push method it would work:
Code: Select all
public void sendMessage()
{
// ...
// persist message on database
// ...
PushContext pushContext = PushContextFactory.getDefault().getPushContext();
pushContext.push("/webapp1/<<common channel id>>", "<<some notification>>");
pushContext.push("/webapp2/<<common channel id>>", "<<some notification>>");
}
Thanks
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
JMS, and I recommend tomee, since you're using tomcat. I started using JMS via ActiveMQ (bundled with tomee+).
Do the 2 web apps communicate or share same database?
Search Google for atmosphere wiki broadcaster, because your code and understanding is not correct.
Do the 2 web apps communicate or share same database?
Search Google for atmosphere wiki broadcaster, because your code and understanding is not correct.
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
They use the same database.smithh032772 wrote:Do the 2 web apps communicate or share same database?
I was actually reading it when I received the notification of new post here .smithh032772 wrote:Search Google for atmosphere wiki broadcaster, because your code and understanding is not correct.
I'm taking a look at the PushServlet code to see if I figure out something.
I'll post this question in the Atmosphere group too.
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
Good. You may want to allow both apps to receive REST requests, and then use PrimeFaces Push on each app to push messages.
Please share your code/implementation here, afterwards.
Please share your code/implementation here, afterwards.
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
The Atmosphere Framework > Push between multiple webapps?FkJ wrote:I'll post this question in the Atmosphere group too.
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
click this, and read that, entirely, especially the code/email that I embedded in the 'code' tags. There, you will see how someone else use 'push rule'.FkJ wrote:I'm trying to figure out how push rules work before replying there.
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
-
- Information
-
Who is online
Users browsing this forum: No registered users and 43 guests