Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7516975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:18:08+00:00 2026-05-30T01:18:08+00:00

I have a Spring MVC web app running on my server. Recently I wanted

  • 0

I have a Spring MVC web app running on my server. Recently I wanted to add a functionality to notify any logged in users that their role has changed, so they can logout and in again.

I thought about using JMX, so did a small test and it worked fine, except that its not broadcasting the message. So for example, if i have 2 logged in persons, only 1 is receiving the message.

So my question is, is it possible to broadcast a message with JMX to all instances of a web app (active sessions)?

Edit – using JMS

So I am trying with JMS right now, here is my configuration file:

<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

<bean id="connectionFactory"
      class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616"/>
</bean>
<bean id="msgDestination"
      class="org.apache.activemq.command.ActiveMQTopic">
    <constructor-arg value="userToLogout.topic"/>
</bean>
<bean id="jmsTemplate"
      class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="pubSubDomain" value="true"/>
    <property name="receiveTimeout" value="10000"/>
</bean>
<bean id="userNotifier"
      class="com.cap.messaging.UserNotifier">
    <property name="destination" ref="msgDestination"/>
    <property name="jmsTemplate" ref="jmsTemplate"/>
</bean>
<bean id="userNotificationListener"
      class="com.cap.messaging.UserNotificationListener">
</bean>
<bean
    class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="connectionFactory" />
    <property name="destinationName" value="userToLogout.topic" />
    <property name="messageListener" ref="userNotificationListener" />
</bean>

This isnt working right now. However it works if I change the ActiveMQTopic to ActiveMQQueue. what am I missing here, and would this work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:18:10+00:00Added an answer on May 30, 2026 at 1:18 am

    I think the short answer is no. JMX is a single connection API which uses RMI over TCP/IP sockets. Best you can do is to serially unicast to all of your instances or use threads and send to all of your web app sessions in parallel over a number of JMX client connections.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web app running Spring 3.0 and using Spring-MVC. I have a
Spring MVC web app: I have a stack trace w/o line numbers (shown at
I have my web application written in Spring MVC. It is quite simple app
I'm running a webapp in Spring Web MVC 3.0 and I have a number
I have an MVC web app running in azure that serves up large files
I am building a web app built on Spring MVC and Hibernate. I have
I have a Spring-MVC, Hibernate, (Postgres 9 db) Web app. An admin user can
I have a Spring Web MVC application that I'd like to serve a large,
I am using Spring MVC to build my web application, and I have a
So I have a spring mvc web application that I built in IntelliJ 9,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.