Results 1 to 4 of 4

Thread: Spring Messaging Service - Helth Check

  1. #1
    Join Date
    Nov 2009
    Posts
    2

    Default Spring Messaging Service - Helth Check

    I've integrated a Active MQ Server and listing its Queue using Spring JMS.
    It is all configured in the xml, which basically invoke the listener bean method on getting a new message in the queue.
    It is working fine.
    Now I've another requirement to check the health status of the queue from a java class.
    But I dont want to post any new message on the queue.
    Is there any API available by which I can only check the connectivity of the queue? Or any api to do an informational query to the queue (like number of message in the queue)?
    In JMS we can create the session using the connection pool by context lookup, that kind of thing also do for me. But I'm not able to do so in Spring as it abstracts the session creation in xml.
    Any help on this?

    Thanks,
    Arpan

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    You might want to simply expose the ActiveMQConnectionFactory as an MBean by adding <context:mbean-export/> in your Spring configuration.

  3. #3
    Join Date
    Nov 2009
    Posts
    2

    Default

    MBean will be good option but will be too heavy for my requirement.
    Is there any way, that I can only check the status of the connectivity of the queue from my Java Code?

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Actually, if you use Spring's MBeanProxyFactoryBean, you can have a very lightweight view of the MBean. You would only need to implement a simple interface with only the methods that you're interested in (e.g. get queue size, consumer count, etc.). Here's the documentation: http://static.springsource.org/sprin...html#jmx-proxy

Tags for this Thread

Posting Permissions

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