Skip to content

JMS, XMPP, ... (via AbstractBroadcasterProxy) : Broadcast to a specific resource #799

Closed
@jimmyjim

Description

Hi

I'm using atmosphere to send messages to some gwt clients from the server (tomcat7).

So i call the method broadcaster.broadcast( String message, AtmosphereResource resourceA );

    Using atmosphere with defaultBroadcaster : everything is ok.

    But if i switch to jmsBroadcaster (activeMq ), the message is delivered to all ressources of the broadcaster and not only the resourceA.

Has someone already test this method with jmsBroadcaster ?

Here is my conf.

<!-- ********************************************************************************************************************* -->
    <!-- SERVLETS Atmosphere -->
    <!-- ********************************************************************************************************************* -->

    <servlet>
        <description>AtmosphereServlet</description>
        <servlet-name>AtmosphereServlet</servlet-name>
        <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class>
        <!-- If you want to use Servlet 3.0 -->
        <async-supported>true</async-supported>
        <init-param>
            <!-- prevent deadlocks -->
            <param-name>org.atmosphere.disableOnStateEvent</param-name>
            <param-value>true</param-value>
        </init-param>

        <!-- By default, the Atmosphere Framework doesn't create sessions and isn't using them. If your application uses HttpSession, you need to tell Atmosphere to track the session as well by enabling it, 
            in web/application.xml: -->
        <!-- This is specially important if you are using WebSocket because of the difference of WebServer implementation, the framework will makes sure it works uniformly with all of them. -->
        <init-param>
            <param-name>org.atmosphere.cpr.sessionSupport</param-name>
            <param-value>true</param-value>
        </init-param>

        <!-- By default, Atmosphere is using the DefaultBroadcaster, which only broadcast events in memory. Enabling one of the Broadcaster described below allow servers/nodes to communicate events between them, 
            e.g when a broadcast operation occurs in on server, the event will also be distributed to other servers. The available Broadcasters are: -->

        <!--JMSBroadcaster : allow events to be broadcasted using JMS implementation like ActiveMQ. -->
        <!--XMPPBroadcaster : Use the XMPP protocol to broadcast events across multiple server. For example, a GMail account can be used to distribute events (because the GMail chat supports XMPP) -->
        <!--HazelcastBroadcaster : allow events to be broadcasted using the Hazelcast framework. -->
        <!--RedisBroadcaster : allow events to be broadcasted using the Redis pubsub API. -->
        <!--JGroupsBroadcaster : allow events to be broadcasted using the JGroups framework. -->
        -->
        <init-param>
             <param-name>org.atmosphere.cpr.broadcasterClassName</param-name>
             <param-value>org.atmosphere.plugin.jms.JMSBroadcaster</param-value>
        </init-param>

        <init-param>     
            <param-name>org.atmosphere.plugin.jms.JMSBroadcaster.JNDINamespace</param-name>
            <param-value>java:comp/env/</param-value>
        </init-param>

        <init-param>
            <param-name>org.atmosphere.plugin.jms.JMSBroadcaster.JNDIConnectionFactoryName</param-name>
            <param-value>jms/atmosphereFactory</param-value>
        </init-param>

        <init-param>
            <param-name>org.atmosphere.plugin.jms.JMSBroadcaster.JNDITopic</param-name>
            <param-value>jms/atmosphereTopic</param-value>
        </init-param>

        <load-on-startup>1</load-on-startup>
    </servlet>

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions