This content has been marked as final.
Show 3 replies
-
1. Re: How to schedule messages?
gaohoward Jun 4, 2009 5:26 AM (in response to shrimad)I think you can do it in your application. JBM 1.4 doesn't provide such utility.
-
2. Re: How to schedule messages?
shrimad Jun 4, 2009 6:34 AM (in response to shrimad)"gaohoward" wrote:
JBM 1.4 doesn't provide such utility.
Ah, ok (( -
3. Re: How to schedule messages?
shrimad Jun 4, 2009 7:05 AM (in response to shrimad)Hooray!!! Made it! ))
<?xml version="1.0" encoding="UTF-8"?> <server> <mbean code="javax.management.timer.Timer" name="jboss.monitor:name=HereTheName,type=Timer"/> <mbean code="org.jboss.monitor.services.TimerService" name="jboss.monitor:name=HereTheName,type=TimerService"> <attribute name="NotificationType">jboss.monitor.herethename</attribute> <attribute name="NotificationMessage">ping!</attribute> <attribute name="TimerPeriod">10sec</attribute> <depends optional-attribute-name="TimerMBean"> jboss.monitor:name=HereTheName,type=Timer </depends> </mbean> <mbean code="org.jboss.monitor.services.ScriptingListener" name="jboss.monitor:service=ScriptingListener"> <attribute name="SubscriptionList"> <subscription-list> <mbean name="jboss.monitor:name=HereTheName,type=Timer"/> </subscription-list> </attribute> <attribute name="ScriptLanguage">beanshell</attribute> <attribute name="Script"> <![CDATA[ import javax.naming.InitialContext; import javax.jms.*; InitialContext ctx = new InitialContext(); TopicConnectionFactory tcf = (TopicConnectionFactory)ctx.lookup("ConnectionFactory"); TopicConnection conn = tcf.createTopicConnection(); TopicSession session = conn.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE); conn.start(); Topic topic = (Topic)ctx.lookup("topic/HeretheTopicName"); TopicPublisher send = session.createPublisher(topic); Message m = session.createMessage(); send.publish(m); send.close(); conn.close(); ]]> </attribute> </mbean> </server>