I want to send messages from the Xpert.ivy server to a HTML Dialog, i.e. to JSF pages. PrimePush supports this but is not yet integrated in Xpert.ivy. How can I use it anyways? asked 07.10.2013 at 12:18 SupportIvyTeam ♦♦ |
Answers for Xpert.ivy 5.0 (Rothorn) with Primefaces 3.5
There are two steps to do. First you have to install the Atmosphere framework on which PrimePush is based on. Second you have to configure PrimePush to use it in Xpert.ivy. For the first step, Atmosphere unfortunately does not provide binary releases. So, please follow the instructions on the Atmosphere homepage to get the Atmosphere jar files. Then move them into the directory webapps/Ivy/WEB-INF/lib of the Designer/Server. For the second step, please open the file webapps/Ivy/WEB_INF/web.xml. Within the web-app tag, add the following text:
Re-start the Designer/Server. To check whether it works not, please use the example project from the Xpert.ivy Hacker. Start the process PrimePush Hello World in multiple browsers and type a message in one of the browsers. If everything is correct you should see the message posted to all browser windows.
answered 07.10.2013 at 13:42 SupportIvyTeam ♦♦ Reguel Werme... ♦♦ I have just added the init-param 'org.atmosphere.useWebSocketAndServlet3'. This is required that non-IO blocking threads are used for AJP connections! (e.g. when Xpert.ivy is integrated with IIS). Otherwise each connection consumes a thread on the server side. As soon as the MaxThreadCount is reached (default value is 200) no more connection could be created and the server will no longer answer.
(10.04.2014 at 16:58)
Flavio Sadeghi ♦♦
Hello Flavio! I want to test before and after I apply useWebSocketAndServlet3 into Ivy Engine. So, Pls give me some information: - Where is MaxThreadCount defined? - How can I test MaxThreadCount is reached? (Do you have a monitor tool to or test tool? Thanks & Regards,
(26.08.2015 at 06:26)
Hap Em
|
Answers for Axon.ivy 5.1 (Lauberhorn) with Primefaces 5.0
The usage of PrimePush has changed in many ways since ivy 5.1 as Primefaces has changed its implementation between primefaces 3.5 (ivy 5.0) and primefaces 5.0 (ivy 5.1). The documentation for Primefaces 5.0 with PrimePush is here. But basically primefaces push still works. There is an updated demo project here: PrimePush_51.iar. It can be set up as follows:
web.xml example:
endpoint example:
If you still run into problem with atomsphere. It can help to get more log outputs form the atmosphere runtime jar. To do so copy the following xml into your designer/configuration/log4jconfig.xml:
answered 21.04.2015 at 09:08 Reguel Werme... ♦♦ Alex Suter ♦♦ Thanks for your solution! After doing a lot of research on internet and make the same demo in eclipse as well to know about mechanism of primepush and atmosphere. --> Yesterday, I have found out the solution (same your solution) in Ivy Designer. and It works correctly now. Thanks again!
(22.04.2015 at 06:27)
Hap Em
Thanks for your reply. I guess that the endpoint can also be registered programatically. But i do not have the time at the moment to find out how. But if you inspect the code in the "AtmosphereFramework" class you should get an idea.
(22.04.2015 at 09:26)
Reguel Werme... ♦♦
Yes. The Endpoints have registered programmatically when the server/designer started. By default, It'll find all classes having @PushEndpoint in WEB-INF/classes.
(23.04.2015 at 04:03)
Hap Em
I mean we should look for a more intuitive way where we do not have to copy classes around the designer and server as this is very unflexible, difficult for deployment. And of course the endpoint is always global instead of local for one pmv.
(23.04.2015 at 08:40)
Reguel Werme... ♦♦
|
Hello All, I have made a demo to use primepush on Ivy 5.1.4 and atmosphere 2.1.6. When I started Ivy --> It showed an error: 13:08:34.123 ERROR [org.primefaces.push.PushServlet] [localhost-startStop-1] [] No Annotated class using @PushEndpoint found. Push will not work. This is my code: xhtml page: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" <br=""/> xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui">
</html> In SendMessage event: JSONObject rs = new JSONObject(); rs.put("pfpd", String.valueOf("Nachricht: " + in.message)); EventBusFactory.getDefault().eventBus().publish("/chat", rs); In web.xml: <servlet> <servlet-name>Push Servlet</servlet-name> <servlet-class>org.primefaces.push.PushServlet</servlet-class> <init-param> <param-name>org.atmosphere.cpr.broadcasterCacheClass</param-name> <param-value>org.atmosphere.cache.UUIDBroadcasterCache</param-value> </init-param> <init-param> <param-name>org.atmosphere.cpr.broadcasterClass</param-name> <param-value>org.atmosphere.cpr.DefaultBroadcaster</param-value> </init-param> <init-param> <param-name>channels</param-name> <param-value>chat</param-value> </init-param> <init-param> <param-name>org.atmosphere.useWebSocketAndServlet3</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>org.atmosphere.cpr.SessionSupport</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> <async-supported>true</async-supported> </servlet> <servlet-mapping> <servlet-name>Push Servlet</servlet-name> <url-pattern>/primepush/*</url-pattern> </servlet-mapping> When I sent a message to "chat" channels --> It's not working Pls help me if you have any idea! Thanks in advance! Regards, answered 20.04.2015 at 08:34 Hap Em We need to do one more step to create Endpoint java class. For example: package ch.soreco.primepush.endpoints; import org.primefaces.push.annotation.OnMessage; import org.primefaces.push.annotation.PushEndpoint; import org.primefaces.push.impl.JSONEncoder; @PushEndpoint("/chat") public class ChatResource { @OnMessage(encoders = { JSONEncoder.class }) public String onMessage(String msg) { return msg; } }
(23.04.2015 at 03:48)
Hap Em
|
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 07.10.2013 at 12:18
Seen: 22,765 times
Last updated: 07.03.2018 at 10:35