Results 1 to 4 of 4

Thread: Listening for notifications from a different application

  1. #1
    Join Date
    Mar 2006
    Location
    Spain
    Posts
    41

    Question Listening for notifications from a different application

    Hi guys,

    I have the following scenario:

    - Several webapps in different servers. Each one with several MBeans registered using Spring support with their corresponding MBeanServers.

    - A different app must listen to the notifications sent by the webapps MBeans (then it has to forward them to different systems, but that's not relevant).

    How can I listen for remote notifications? Is it possible using Spring support? If not... could somebody point me in the right direction to do it directly with JMX API?

    I know I can invoke methods in remote MBeans using client-side JSR-160 connectors (MBeanServerConnectionFactoryBean) and proxies (MBeanProxyFactoryBean) but I don't think I can listen to the notifications that those MBeans send...

    Thanks in advance,

    Jose Luis.

  2. #2
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    The answer might depend on what you mean by "notifications", but if you already have a client-side API (e.g. JSR160) that is at least half the battle, so you could probably use it in some way.

    Do you want to publish ApplicationEvents in your remote applications? This could be achieved by writing a special MBean that fires an ApplicationEvent, e.g. taking a String argument as the name of a prototype bean of the correct type, resolving it in the BeanFactory and then publishing. It depends on the complexity of your events, how easy it is to achieve something useful with this approach. There is nothing out of the box to directly support this pattern (as far as I am aware) because the ApplicationEvents would be specific to your implementation.

  3. #3
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    I realized that you probably mean "notifications" as in javax.management.Notification. Duh! Anyway, I guess you just need to set up your client to invoke the methods that cause the notifications on the remote bean.

  4. #4

    Default JMX Notifications with Spring

    You can find an example of how to do that here
    Last edited by erezmazor; Feb 25th, 2010 at 03:35 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •