RichFaces Push allows you to perform realtime client side updates triggered via events from the server side. We integrate with the Atmosphere framework which provides various transport mechanisms according to concrete browser support(Comet, HTML5 WebSockets). On the server events are managed by integrating Java Messaging Service (JMS). This provide enterprise level messaging integration all the way to the browser!

In this blog I will describe our irc-client example application that was created to introduce the RichFaces push features. It provides the following functionality:

  • Connect to the IRC server
  • Join a channel with choosen nickname
  • Receive all channel messages (nick change, join, part...)
  • Send messages to the channel
  • Observe the list of joined users with real-time updates

In this blog I'm only going to review the important configuration, and source code snippets from the application. The full source code can be checked out from SVN so you can try it for yourself. Instructions for building and deploying the application is in the readme.txt.


To save time with application setup I have created a starter application using richfaces-archetype-simpleapp archetype. Next we need to update application pom.xml to add Atmosphere fremework dependency. For the client side a4j:push uses jquery-atmosphere.js plugin (added implicitly by the component renderer).

NOTE: that particular sample targeted for JBoss 6 Application Server. So we will use JBoss HornetQ available out of the box. Using RichFaces Push under Tomcat or Jetty requires additional JMS dependencies and configuration code. We will work on maven profiles and additional optional classes for that case also in future releases. At the moment the only place to review that configuration is with our developer demo which configured for tomcat using external HornetQ dependencies and configuration class for its initialization.

We need to add the atmosphere-runtime to the pom.xml. This is only needed if you are using the push component.


Also as the demo shown there provides simple IRC client we added one more dependency:


PircBot is a simple framework for writing IRC bots.

Configuring JMS

Lets first discuss why we need JMS at all? Why not just use for example push context object? The answer is pretty straightforward. Usage of JMS at the back-end provides excellent integration with EE containers, and advanced messaging services. It also frees you from managing various entities at your business layer. If you are already using JMS for messaging in your application - you will just continue to send the same messages and you just need to to declare a4j:push at views which should listen that topics.

We assume that you're familiar with JMS so will not provide details here. To learn more about it visit JMS documentation.

Now it is time to configure JMS for our example. We will use JBoss 6 AS for application deployment as mentioned in dependencies section. So we'll use JMS server bundled with JBoss AS. We need to create topics which will be used by Push to check for the messages. Let's start JBoss 6 AS and open http://localhost:8080/admin-console. We will use default admin/admin credentials to log-in. Then click the JMS topics in navigation menu and create new JMS topic with the following settings:

Name: chat

JNDI name: /topic/chat All the others: by default.

In the same form we need to add roles for that topic. For that demo application we will create single role with next parameters:

Name: guest

Send: yes

Consume: yes

create subscriber: yes

delete subscriber: yes

create durable subscriber: yes

delete durable subscriber: yes

IMPORTANT: The last two options are critical for push functionality as we using durable subscriptions in order to be able to receive all the events including ones which were sent while the push was not connected to the server. So if they are set to false - push will not be able to register subscribers.

So here is what you should see after JMS setting done:

That's all. Now we are ready with JMS configuration.

NOTE: if you not familiar with JBoss configuration using admin-console visit JBoss AS Administration Console User Guide.

Web Application Configuration

Now let's add application settings required by RichFaces Push. We need an additional filter and a few context-param's to be added. Here is what we used for that demo application:

    <servlet-name>Faces Servlet</servlet-name>

Let's review those parameters in details. At first we need the PushFilter to be installed and mapped to Faces Servlet. It will handle the push request and serve event using the Atmosphere runtime. And connectionUserName and connectionPassword context parameters are needed in order to defined the credentials used to work with JMS for connecting and subscribing to topics.

Here is the table with all the parameters which could be used in your application:

context-param Name Default value Description
org.richfaces.push.jms.connectionFactory /ConnectionFactory JMS connection factory JNDI name
org.richfaces.push.jms.topicsNamespace /topic used as a root name from which all topics are resolved: i.e. 'chat' topic by default will be looked up via /topics/chat JNDI name.
org.richfaces.push.jms.connectionUsername - Username used for connection and topics creation/listening
org.richfaces.push.jms.connectionPassword - Password used for connection and topics creation/listening

Note: there are also JNDI references to credentials strings available:

  • java:comp/env/org.richfaces.push.jms.connectionUsername
  • java:comp/env/org.richfaces.push.jms.connectionPassword

An alternative to using web.xml definitions is to provide all the parameters using properties file org/richfaces/

TopicsContext initialization

Now we need to initialize org.richfaces.application.push.TopicsContext with the JMS topics we will listen for. For this purpose we created a JSF 2 System Event listener which handles PostConstructApplicationEvent:

public class TopicsInitializer implements SystemEventListener {
   public void processEvent(SystemEvent event) throws AbortProcessingException {
       TopicsContext topicsContext = TopicsContext.lookup();
       Topic topic = topicsContext.getOrCreateTopic(new TopicKey("chat"));
       topic.addTopicListener(new SessionTopicListener() {...});
  public boolean isListenerForSource(Object source) {
       return true;

and registered it in faces-config:


With this we have created new topic in TopicContext with chat name (the same as we defined configuring the JMS).

Actually MessageDataSerializer and TopicListener creation are optional, so let's briefly describe the main idea of these objects.

  • Messages serializer is used to serialize the message to the expected format for passing to the client. By default built-in serializer will serialize the message data to JavaScript.
  • Session topic listener is used to handle subscriptions (pre and post-processing) and unsubscription events. This could be used for example in order to check user permissions prior to connecting to some topic and perform some additional post-processing after some push component successfully attached to topics. In the sample there are just logging used so the code is omitted there.

Application Code

We are done with settings and push initialization stuff, and it's time to actually explore the example code to see how we manage the IRC connections, and how push is used for page updates according to server-side events.

Logging to IRC

This section is not directly related to Push but describes the code used for connection to IRC. Here is the simple page used:

<rich:panel header="Connect to IRC">
        <rich:messages style=”color:red”/>
            <h:panelGrid columns="2">
                <h:outputText value="Your nickname:" />
                <h:inputText required="true" id="name" value="#{chatBean.userName}" />
                <h:outputText value="Channel:" />
                <h:outputText value="RichFaces" style="font-weight:bold"/>                        
                <h:outputText value="Server:" />
                <h:outputText value="" style="font-weight:bold"/>                
        <h:commandButton value="Connect" action="#{chatBean.connect}" />

It's rendered as:

Note that for simplicity purposes the channel and server names are using constants. In the future we plan to extend the sample with ability to open multiple channels and so on..

And here is the used:

public class ChatBean extends PircBot implements Serializable {
private static final String SERVER_URL = "";
private static final int SERVER_PORT = 6667;
private static final String CHANNEL_PREFIX = "#";
private static final String SUBTOPIC_SEPARATOR = "_";
private static final String DEFAULT_CHANNEL = "richfaces";
private String channelName;
private String message;
public String connect() {
       try {
           this.connect(SERVER_URL, SERVER_PORT);
           this.joinChannel(CHANNEL_PREFIX + DEFAULT_CHANNEL);
           channelName = DEFAULT_CHANNEL;
       } catch (NickAlreadyInUseException e) {
               new FacesMessage(FacesMessage.SEVERITY_ERROR, this.getName() + " nick 
               already in use", this.getName()
               + " nick already in use"));
           return null;
       } catch (IOException e) {
               new FacesMessage(FacesMessage.SEVERITY_ERROR, "Sorry, server unresponsive. 
               Try again later.",
               "Sorry, server unresponsible. Try again later."));
           return null;
       } catch (IrcException e) {
               new FacesMessage(FacesMessage.SEVERITY_ERROR,
                   "Sorry, we encountered IRC services problems. Try again later.",
                   "Sorry, we encountered IRC services problems. Try again later."));
        return null;
       return "chat";

As you can see our bean extends the PirBot abstract class. So we just using PircBot api in order to get connected to server. And performing redirect to most interesting for us chat.xhtml page.

Client main page

Screenshot below shows you the result we want to achieve on that page:

Here is the complete listing of the chat.xhtml page. We'll review it in details below:

    function getMessageString(data){
        return + " - " +data.timestamp+ ": " + data.text;
<rich:panel header="Welcome to #{chatBean.channelName} channel at #{chatBean.serverName}" 
    <rich:panel styleClass="chatOutput" bodyClass="#{chatBean.channelName}Output" />
    <rich:panel styleClass="chatList">
        <rich:list value="#{chatBean.users}" var="user" id="users" type="unordered">
    <br clear="all" />
    <hr />
        <a4j:push address="#{chatBean.listSubtopic}@chat"
            <a4j:ajax event="dataavailable" render="users" execute="@none" />
        <a4j:push address="#{chatBean.messagesSubtopic}@chat"
            onerror="alert(" ondataavailable="jQuery('&lt;div/&gt;').
            getMessageString(" />
        <h:inputTextarea value="#{chatBean.message}" rows="3" style="width:80%" id="nm" />
        <a4j:commandButton value="Send" action="#{chatBean.send}" render="@none" execute="@form" />
    <hr />
        <rich:panel header="Change nickname:">
            <h:inputText valueChangeListener="#{chatBean.changeNick}" id="cn" />
            <a4j:commandButton value="Change" execute="@form" render="@none"/>
        <h:commandButton value="Disconnect" action="#{chatBean.leave}"/>

I will show you two options of performing push updates.

  1. Using ondataavailable JavaScript handler which will grab the data from the JMS event directly on the client.
  2. Using a4j:ajax behavior to trigger an Ajax request which will perform partial update when the push informs us about server event.

So the first panel:

<rich:panel styleClass="chatOutput" bodyClass="#{chatBean.channelName}Output" />

is just a container for the chat text which will be updated via JavaScript.

And the second panel:

<rich:panel styleClass="chatList">
    <rich:list value="#{chatBean.users}" var="user" id="users" type="unordered">

contains the rich:list component which displays the users connected to the channel. It will be updated via an Ajax request that is triggered when the event about list change is populated at server side.

Client side updates on server-side events using JavaScript

Let's review the first a4j:push component more closely:

<a4j:push address="#{chatBean.messagesSubtopic}@chat" onerror="alert("
    text(getMessageString(" />

It's used to get the messages into the main chat window. Here is the TopicContext declaration and main methods from the ChatBean which are generates events for that push:

import org.richfaces.application.push.TopicKey;
import org.richfaces.application.push.TopicsContext;
private transient TopicsContext topicsContext;
public String getMessagesSubtopic() {
   return this.getUserName() + SUBTOPIC_SEPARATOR + channelName;
private TopicsContext getTopicsContext() {
if (topicsContext == null) {
topicsContext = TopicsContext.lookup();
return topicsContext;
protected void onMessage(String channel, String sender, String login, String hostname, String message) {
   try {
       Message messageObject = new Message(message, sender, DateFormat.getInstance().format(
new Date()));
       getTopicsContext().publish(new TopicKey("chat", getMessagesSubtopic()), messageObject);
   } catch (MessageException e) {
       LOGGER.error(e.getMessage(), e);
public void send() {
   this.sendMessage(CHANNEL_PREFIX + channelName, message);
   try {
       Message messageObject = new Message(message, this.getName(), 
DateFormat.getInstance().format(new Date()));
       getTopicsContext().publish(new TopicKey("chat", getMessagesSubtopic()), messageObject);
   } catch (MessageException e) {
       LOGGER.error(e.getMessage(), e);

onMessage method - just overriden PircBot method and it's invoked when the message comes from the other chat users. And send method is invoked when we are sending a message. This is a standard JSF action of the send button.

As you can see in order to raise an event for a4j:push we just publish it to the TopicContext. publish method accepts two parameters:

  • TopicKey key - adress which consist of topic and subtopic names.
  • Object data - actual data passed to client side event.

Messages subtopic generated by getMessagesSubtopic() method used by a4j:push component on the page and is unique for every user and channel, so only current user will receive the event populated by the object.

The Message object passed as data is pretty simple POJO with three String properties - author, text and timestamp. It's later used on the client in push oncomplete to create formatted string by getMessageString(data) JavaScript method and later add to chat div:

    function getMessageString(data){
        return + " - " +data.timestamp+ ": " + data.text;
IMPORTANT: As was mentioned before the other way to publish an event is by just sending it to JMS bus. So you have no need to use our TopicContext in this common case. We've just used this approach for simple example as we have no components other than our simple JSF bean. See Additional Details section for more information about publishing via JMS bus.

Ajax updates on server-side events using a4j:ajax

Now let's review the second approach to perform updates according to events received by a4j:push:

<a4j:push address="#{chatBean.listSubtopic}@chat" onerror="alert(">
    <a4j:ajax event="dataavailable" render="users" execute="@none" />

It's used to update the rich:list which shows the current channel users. Here is the main methods from the ChatBean which are generates events for that push:

public String getListSubtopic() {
   return this.getUserName() + SUBTOPIC_SEPARATOR + channelName + "List";
protected void onUserList(String channel, User[] users) {
   try {
       getTopicsContext().publish(new TopicKey("chat", getListSubtopic()), null);
   } catch (MessageException e) {
       LOGGER.error(e.getMessage(), e);
protected void onJoin(String channel, String sender, String login, String hostname) {
   try {
       getTopicsContext().publish(new TopicKey("chat", getListSubtopic()), null);
       Message messageObject = new Message("joined channel", sender, 
           DateFormat.getInstance().format(new Date()));
       getTopicsContext().publish(new TopicKey("chat", getMessagesSubtopic()), messageObject);
   } catch (MessageException e) {
       LOGGER.error(e.getMessage(), e);

We are using the same publishing through TopicContext at server side just defining different subtopic for that a4j:push. And passing null as data because we do not planning to process anything at client side. That's where:

<a4j:ajax event="dataavailable" render="users" execute="@none" />

come in play. When push receives the event an ajax behavior sends a request which just perform rich:list render with new values. Pretty simple isn't it?

Additional Details

There I want to pay your attention to some details not covered within the article.

Single Connection

As you can see in this example we used two a4j:push component on a single page in order to demonstrate two different ways to process push events. It is important to know that this does not mean wo connections are getting opened. All the instances of the push component uses single connection and only the subscribed one gets the event for processing according to it's adress after some event is received. You can verify that by using Firebug for FireFox for example.

Publishing via JMS bus

JMS messages types supported by push are:

  • ObjectMessage
  • TextMessage

Corresponding data from getObject or getText passed to DataSerializer and getting serialized to the client data(to JavaScript using default serializer).

To be Continued...

And finally I want to announce topics which planned to be covered in next Push related articles.

Integration with CDI events

Being a first class citizen in JEE6 ecosystem CDI getting paid much attention during RichFaces development for sure. And support of CDI event system by a4j:push are also topic for upcoming separate blog entry!

And more...

There are a lot of possibilities with this component, too many to describe using just a single article. So follow our blogs or RichFaces twitter for any future examples and documentation updates related to this great component!

[Get updates of my blogs in twitter]

[My blog]

24. Mar 2011, 08:31 CET | Link

This is incredible feature and I love it. Richfaces team proved again that RF is top choice JSF component for enterprises. Thanks RF team.

24. Mar 2011, 11:36 CET | Link

Thanks! Let us know about any info or feature missed or not completelly understandable(hope will not find at least during basic examination :) ).. We really need feedback on such big features to make sure them are designed/documented well for the community.

26. Mar 2011, 14:45 CET | Link
This may be a stupid question, but how does the session instance of ChatBean get registered as a jms listener?

Also, does the ContextTopic push data to all clients of the application, or is it somehow tied to a particular session? If its tied to a session, where does that Happen? If not, won't all client in a Subchannel get n messages, where n is the number of Cliennts?

29. Mar 2011, 20:35 CET | Link

ChatBean is not registered as JMS listener, push component provides JMS listener instead.

Each connected client (i.e. browser window) gets internal push session, so when message is published, it's being broadcast to all active sessions connected to that topic. All sub-channels are connected to the JMS topic, sub-channel name is used in criteria that filters messages.
30. Mar 2011, 16:14 CET | Link

Hi I tried to use this example with glassfish but I just get Class not found exception when trying to use the FilterServlet. Seems to require CometProcessor?

31. Mar 2011, 15:13 CET | Link

Speaking kindly I do not tested it under glassfish. please create forum thread describing current environment and including stacktraces.

08. Apr 2011, 05:51 CET | Link

You need to add the atmosphere-runtime dependencies. If you don't use maven, download this jars:

atmosphere-runtime-0.7.1.jar atmosphere-compat-jbossweb-0.7.1.jar atmosphere-compat-tomcat-0.7.1.jar atmosphere-compat-weblogic-0.7.1.jar atmosphere-ping-0.7.1.jar

you can find all of this from here

PS: This only solves the dependencies problem... but I'm new to JMS and I don't know how to configure the JMS in the glassfish admin-console, it's really diferent from the jboss6as admin-console, can somebody be kind to post an example on how to configure the JMS part on glassfish 3.1?

09. Apr 2011, 11:18 CET | Link
Pedro Picapiedra

I'm getting this error when the TopicsInitializer gets called. I'm using glassfish 3.1.

WARNING: MQJMSRA_DC2001: Unsupported:setClientID():inACC=false:connectionId=6046697373872048384
SEVERE: java.lang.ExceptionInInitializerError
        at org.richfaces.application.push.impl.jms.PushContextFactoryImpl.getPushContext(
        at org.richfaces.application.push.TopicsContext.lookup(
        at com.dotachile.pushmaven.TopicsInitializer.processEvent(
        at javax.faces.event.SystemEvent.processListener(
        at com.sun.faces.application.ApplicationImpl.processListeners(
        at com.sun.faces.application.ApplicationImpl.invokeListenersFor(
        at com.sun.faces.application.ApplicationImpl.publishEvent(
        at com.sun.faces.config.ConfigManager.publishPostConfigEvent(
        at com.sun.faces.config.ConfigManager.initialize(
        at com.sun.faces.config.ConfigureListener.contextInitialized(
        at org.apache.catalina.core.StandardContext.contextListenerStart(
        at com.sun.enterprise.web.WebModule.contextListenerStart(
        at org.apache.catalina.core.StandardContext.start(
        at com.sun.enterprise.web.WebModule.start(
        at org.apache.catalina.core.ContainerBase.addChildInternal(
        at org.apache.catalina.core.ContainerBase.addChild(
        at org.apache.catalina.core.StandardHost.addChild(
        at com.sun.enterprise.web.WebContainer.loadWebModule(
        at com.sun.enterprise.web.WebContainer.loadWebModule(
        at com.sun.enterprise.web.WebApplication.start(
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(
        at org.glassfish.deployment.admin.DeployCommand.execute(
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(
        at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(
        at com.sun.enterprise.v3.admin.AdminAdapter.service(
        at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(
        at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(
        at com.sun.grizzly.comet.CometEngine.executeServlet(
        at com.sun.grizzly.comet.CometEngine.handle(
        at com.sun.grizzly.comet.CometAsyncFilter.doFilter(
        at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(
        at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(
        at com.sun.grizzly.arp.AsyncProcessorTask.doTask(
        at com.sun.grizzly.http.TaskBase.execute(
        at com.sun.grizzly.arp.DefaultAsyncHandler.handle(
        at com.sun.grizzly.arp.AsyncProtocolFilter.execute(
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(
        at com.sun.grizzly.DefaultProtocolChain.execute(
        at com.sun.grizzly.DefaultProtocolChain.execute(
        at com.sun.grizzly.http.HttpProtocolChain.execute(
        at com.sun.grizzly.ProtocolChainContextTask.doCall(
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(
        at com.sun.grizzly.util.AbstractThreadPool$
Caused by: javax.faces.FacesException: MQJMSRA_DC2001: Unsupported:setClientID():inACC=false:connectionId=6046697373872048384
        at org.richfaces.application.push.impl.jms.PushContextImpl.init(
        at org.richfaces.application.push.impl.jms.PushContextFactoryImpl.createInstance(
        at org.richfaces.application.push.impl.jms.PushContextFactoryImpl.access$000(
        at org.richfaces.application.push.impl.jms.PushContextFactoryImpl$PushContextHolder.<clinit>(
        ... 58 more
Caused by: javax.jms.JMSException: MQJMSRA_DC2001: Unsupported:setClientID():inACC=false:connectionId=6046697373872048384
        at com.sun.messaging.jms.ra.DirectConnection._unsupported(
        at com.sun.messaging.jms.ra.DirectConnection.setClientID(
        at org.richfaces.application.push.impl.jms.MessagingContext.start(
        at org.richfaces.application.push.impl.jms.PushContextImpl.init(
        ... 61 more
10. Apr 2011, 02:32 CET | Link
Paul M.

maybe this has something to do with this problem in glassfish.

09. May 2011, 00:21 CET | Link
Nick Belaevski

Related to GlassFish, please take a look here: JIRA

19. May 2011, 15:55 CET | Link
birol karatay | birolkaratay(AT)

I've tried to do myself this sample but I've got some errors while running.

I'm using Jboss 6.0 Final AS. I've downloaded from SVN and made a web application. I added all libraries to lib folder. When I started to JBoss I got this code:

16:34:35,173 ERROR /irc-client Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossMojarra20ConfigureListener: java.lang.NoClassDefFoundError: org/atmosphere/cpr/AtmosphereHandler at org.richfaces.application.push.impl.jms.PushContextFactoryImpl.createInstance( :4.0.0.Final at org.richfaces.application.push.impl.jms.PushContextFactoryImpl.access$000( :4.0.0.Final at org.richfaces.application.push.impl.jms.PushContextFactoryImpl$PushContextHolder.( at org.richfaces.application.push.impl.jms.PushContextFactoryImpl.getPushContext( :4.0.0.Final at org.richfaces.application.push.TopicsContext.lookup( :4.0.0.Final at org.ircclient.listeners.TopicsInitializer.processEvent( at javax.faces.event.SystemEvent.processListener( at com.sun.faces.application.ApplicationImpl.processListeners( :2.0.3-FCS at com.sun.faces.application.ApplicationImpl.invokeListenersFor( at com.sun.faces.application.ApplicationImpl.publishEvent( at com.sun.faces.config.ConfigManager.publishPostConfigEvent( :2.0.3-FCS at com.sun.faces.config.ConfigManager.initialize( :2.0.3-FCS at com.sun.faces.config.ConfigureListener.contextInitialized( :2.0.3-FCS at org.jboss.web.jsf.integration.config.JBossMojarraConfigureListener.contextInitialized( :1.0.3

Please Help me...

06. Jun 2011, 13:44 CET | Link

Nice article! I only had troubles with connecting to the IRC server, but now it works with another! :)


17. Jun 2011, 17:09 CET | Link

Anybody can provide an example to set up server push with JBoss 4.2.1? The RichFaces 4 showcase examples and core-demo are working with JBoss 4.2.1.

Need it urgently. I made prototyping with Richfaces 3.3.3. Now I am at the point to decide using RF3 or RF4 in the real development.

Also where to find url for tag library of RF4 like RF 3:

20. Jun 2011, 16:17 CET | Link
Don Samson

Hi ,

Me too in the same boat..

With Jboss 6 i am able to run ircclient sample. I was trying to make it working with Jboss 4.2.1. I see that my messages are getting published. however i don't see the push getting update. I just wrote one more test subscriber for the same topic. I get the messages in my client but push is not getting it. I don't get my error too. Here is my JBoss 4.2.1 Mbean set up. My Topic declaration.


<mbean code=""
     <depends optional-attribute-name="DestinationManager"></depends>
           <depends optional-attribute-name="SecurityManager"></depends>
           <attribute name="SecurityConf">
                              <role name="guest" read="true" write="true" create="true"/>
          <attribute name="useDLQ">jboss.messaging.destination:service=Queue,name=DLQ</attribute>
Do I need to do something about DLQ? I made this and Durable subsription

10. Jul 2011, 14:44 CET | Link

Hi, In fisrt i'll find 'cool' chat application. The sample seems easy when you use 'static' topics.

For my application i don't see how to do it, because i've a private chat ( each user have a single popup divided in twoo parts :

  1. a list with correspondants
  2. the conversation historic of selected correspondant in the list ( 1 )

Actually in richfaces 3.3.3 i use a a4j push, which interrogate a map of conversation in a bean session of each user logged and connected to the chat.

With this mechanism of JMS i don t see how i can do it?

  1. So is it possible to create/delete dynamically a TOPIC in JMS.?
  2. Or does it exist another way?
  3. I think in particular to 'glue' the push to the chat bean in each session.

If you ave an idea of the best usage i can do the new push in RF 4, I m very interresting.


16. Jul 2011, 17:37 CET | Link
Is it possible to use the push feature without JMS?
I agree that JMS integration is great in certain cases - such as when you need to integrate with other systems, but I have a stand-alone web application that doesn't need JMS for any reason. The application generates events, and I want to push them to the user. I currently do this with RichFaces 3.x and it works perfectly.
I'd like to upgrade to v4, but I really don't want to install & configure a JMS server - it complicates the architecture and introduces additional dependencies for no good reason (in my case). So... can I still simply push directly to this component without JMS?

Thanks in advance.
26. Jul 2011, 10:22 CET | Link

Hi, I m going tu use jboss AS 7( no jms). How can we use push with other that jms? Thanks

17. Nov 2011, 17:55 CET | Link
At the moment the only place to review that configuration is with our developer demo which configured for tomcat using external HornetQ dependencies and configuration class for its initialization.

Where??? Could you kindly point me to the download page of the developer demo or to an example in order to be able to use push on tomcat?

Thanks a lot

20. Nov 2011, 18:40 CET | Link

I agree with Pier, it would be very fine knowing where is that docs. Thanks a lot

21. Nov 2011, 20:45 CET | Link

Hi Pier, look at these links : If you could get a working tomcat environment with a4j:push (richfaces 4), please submit your tomcat and hornetq config files.

02. Dec 2011, 08:15 CET | Link

Is it possible to configure jms push mechanism for the following scenario:

- My RichFaces (4.0.0.Final) application runs on tomcat (6.0.33) - My ActiveMQ runs as an osgi bundle within servicemix configured with just on jms topic

Several osgi bundles publish messages for all RichFaces application users. So I'm only interested in push notifications.

Here my back end bean regarding ActiveMQ connection initialization:

// Create a ConnectionFactory
            ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");

            // Create a Connection
            jmsConn = connectionFactory.createTopicConnection();

            // Create a Session
            jmsSession = jmsConn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

            //Create a Topic
            jmsTopic = jmsSession.createTopic(JMS_TOPIC_NAME);

            //Create a Subscriber
            jmsSubscriber = jmsSession.createSubscriber(jmsTopic);
            jmsSubscriber.setMessageListener(new MessageListener() {

                public void onMessage(Message message) {
                    try {
                        getTopicsContext().publish(new TopicKey(JMS_TOPIC_NAME), message);
                    } catch (MessageException e) {
                        // TODO Auto-generated catch block
                    } catch (JMSException e) {
                        // TODO Auto-generated catch block
How should the web.xml file looks like?

Thanks a lot!

23. May 2013, 05:04 CET | Link

Is there any special configuration that needs to be done on Apache Webserver fronting RichFaces for the same? I got the sample running on Glassfish. Later, I configured Apache fronting Glassfish. I can reach application pages via apache. But, the message consumer page is not displaying the messages.

Post Comment