Configuration of PF-Push with Apache Server Load Balancing

UI Components for JSF
ITStudent
Posts: 64
Joined: 18 Oct 2011, 22:25

23 Nov 2012, 15:31

Hey,

i have 2 Tomcats (ports: 8080 and 8081) instance and Apache Http Server.
how can I set that the two tomcats using only a primefaces push of tomcat 3 (port: 8083)?
The configuration in 3 tomcats web.xml:

Code: Select all

 <context-param>
    <param-name>primefaces.PUSH_SERVER_URL</param-name>
    <param-value>http://testhost:8083</param-value>    
  </context-param>
what must be set in the file httpd.conf ?

Many thanks for any help.
Last edited by ITStudent on 25 Nov 2012, 15:29, edited 2 times in total.

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

24 Nov 2012, 02:02

I was trying to search for how to start TomEE (tomcat) as a Windows service on a Windows Server 2003 machine, and I found the following:

Installing Tomcat 6 with Java 6 and Apache 2.2 on Windows Server 2003 x64

5 Scenarios and Best Practices for Running Multiple Instances of Tomcat or tc Server

Hopefully that can you a little bit.
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

ITStudent
Posts: 64
Joined: 18 Oct 2011, 22:25

24 Nov 2012, 14:11

hey smithh032772,

The tomcat instances run flawlessly and the application also.
That problem is the primefaces push doesn' t work , the two instances must use the same server primefaces push.

the config of apache http server:

httpd.conf:

Code: Select all

JkWorkersFile "path/balancer.properties"
JkMount /* balancer  
balancer.properties:

Code: Select all

worker.list=balancer
worker.tomcat1.port=8080
worker.tomcat1.host=testhost
worker.tomcat1.type=ajp13
worker.tomcat1.lbfactor=5

worker.tomcat2.port=8081
worker.tomcat2.host=testhost
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor=5

worker.tomcat3.port=8082
worker.tomcat3.host=testhost
worker.tomcat3.type=ajp13
worker.tomcat3.lbfactor=5


worker.balancer.type=lb
worker.balancer.sticky_session=1
worker.balancer.balance_workers=tomcat1,tomcat2

how do I get to run the primefaces push?
Last edited by ITStudent on 25 Nov 2012, 19:10, edited 2 times in total.

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

24 Nov 2012, 17:06

Please ask your question at the following:

https://github.com/Atmosphere/atmospher ... ate=closed

Sorry, I have no experience with Apache Server.
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

ITStudent
Posts: 64
Joined: 18 Oct 2011, 22:25

25 Nov 2012, 19:09

thanks for your quick response
But maybe can you tell me how is the configuration of www.primfaces.org in httpd.conf: file or how to integrate primefaces push with Atmosphere Spade Server ?

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

29 Nov 2012, 10:51

In a cluster you need to replicate push data between cluster members using JMS (for instance) so that data pushed by one cluster member can be pushed by the others.
Although it sounds complicated it isn't actually that hard. Things are made a lot easier when you can use Message Driven Beans of course as these act as the immediate end points for messages from JMS.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

29 Nov 2012, 14:57

Andy,

Replicate push data via JMS between cluster members?

Currently, my TomEE/CDI-managed-bean web application pushes data to client(s), perfectly, but what I really want to do is deploy my CDI-managed-bean web application to Glassfish3.1.2.2/WELD, and possibly use Message Beans to send data from Glassfish to TomEE, and TomEE (PrimeFaces Push) will push data to the same clients that are being served by Glassfish/CDI-managed-beans.

I think I need to keep all same code I have now, xhtml page references Push channel, Glassfish/CDI-managed-bean will define the actual push channel ID, and TomEE/PrimeFaces Push will push the data to push channel requested/specified by Glassfish/CDI-managed-bean.

That seems easy, but if Glassfish is serving pages via http://somehost:8080, I don't understand how TomEE can share the same http://somehost:8080.

Also, I'm having a hard time understanding how to 'package' my CDI WAR file as per WELD-846 issue, so my CDI app will run on Glassfish 3.1.2.2. Once I get this working, then I can move onto more fun stuff like integrating Glassfish and TomEE/PrimeFaces Push. :)
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

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

29 Nov 2012, 17:58

Howard,

with a load balanced cluster clients are going to be connected to which ever App Server the load balancer says they should without them knowing the difference.
In a Push scenario you have to push data from all members of the cluster so that clients connected to them receive the data.
If the data to be pushed results in an interaction by a client (chat?) or if it is the result of a change made in another system (robot turning left) the result is the same.
You have to publish data to be pushed so that all members of the cluster can push to connected clients. In Java this means using JMS.

This means that the rules for push channels as far as the load balancing server config are the same, only need to make sure that you have rules for the WebSocket protocols which match http(s) ones.

One thing I have not explored but which would be very useful is being able to use PUSHes from a server different to the one my app is served from. Obviously XSS should not be subverted here but it should be possible. I already have a requirement for this.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

29 Nov 2012, 18:54

Okay/digesting. Please blog about the implementation of your requirement, when complete. :)

This is interesting neat stuff!
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

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

30 Nov 2012, 16:06

smithh032772 wrote:Okay/digesting. Please blog about the implementation of your requirement, when complete. :)

This is interesting neat stuff!
Do you want me to create a GitHub project and have you take my daughter to dinner as well?
BTW Blog has a new Post.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 42 guests